Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2caff147 authored by Dominik Brodowski's avatar Dominik Brodowski
Browse files

pcmcia: use dynamic debug infrastructure, deprecate CS_CHECK (wireless)



Convert PCMCIA drivers to use the dynamic debug infrastructure, instead of
requiring manual settings of PCMCIA_DEBUG.

Also, remove all usages of the CS_CHECK macro and replace them with proper
Linux style calling and return value checking. The extra error reporting may
be dropped, as the PCMCIA core already complains about any (non-driver-author)
errors.

CC: linux-wireless@vger.kernel.org
CC: netdev@vger.kernel.org
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent 624dd669
Loading
Loading
Loading
Loading
+16 −32
Original line number Diff line number Diff line
@@ -43,21 +43,6 @@

#include "airo.h"

/*
   All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
   you do not define PCMCIA_DEBUG at all, all the debug code will be
   left out.  If you compile with PCMCIA_DEBUG=0, the debug code will
   be present but disabled -- but it can then be enabled for specific
   modules at load time with a 'pc_debug=#' option to insmod.
*/
#ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0);
static char *version = "$Revision: 1.2 $";
#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args);
#else
#define DEBUG(n, args...)
#endif

/*====================================================================*/

@@ -145,7 +130,7 @@ static int airo_probe(struct pcmcia_device *p_dev)
{
	local_info_t *local;

	DEBUG(0, "airo_attach()\n");
	dev_dbg(&p_dev->dev, "airo_attach()\n");

	/* Interrupt setup */
	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
@@ -184,7 +169,7 @@ static int airo_probe(struct pcmcia_device *p_dev)

static void airo_detach(struct pcmcia_device *link)
{
	DEBUG(0, "airo_detach(0x%p)\n", link);
	dev_dbg(&link->dev, "airo_detach\n");

	airo_release(link);

@@ -204,9 +189,6 @@ static void airo_detach(struct pcmcia_device *link)

  ======================================================================*/

#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)

static int airo_cs_config_check(struct pcmcia_device *p_dev,
				cistpl_cftable_entry_t *cfg,
				cistpl_cftable_entry_t *dflt,
@@ -291,11 +273,11 @@ static int airo_config(struct pcmcia_device *link)
{
	local_info_t *dev;
	win_req_t *req;
	int last_fn, last_ret;
	int ret;

	dev = link->priv;

	DEBUG(0, "airo_config(0x%p)\n", link);
	dev_dbg(&link->dev, "airo_config\n");

	req = kzalloc(sizeof(win_req_t), GFP_KERNEL);
	if (!req)
@@ -315,8 +297,8 @@ static int airo_config(struct pcmcia_device *link)
	 * and most client drivers will only use the CIS to fill in
	 * implementation-defined details.
	 */
	last_ret = pcmcia_loop_config(link, airo_cs_config_check, req);
	if (last_ret)
	ret = pcmcia_loop_config(link, airo_cs_config_check, req);
	if (ret)
		goto failed;

	/*
@@ -324,21 +306,25 @@ static int airo_config(struct pcmcia_device *link)
	  handler to the interrupt, unless the 'Handler' member of the
	  irq structure is initialized.
	*/
	if (link->conf.Attributes & CONF_ENABLE_IRQ)
		CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
		ret = pcmcia_request_irq(link, &link->irq);
		if (ret)
			goto failed;
	}

	/*
	  This actually configures the PCMCIA socket -- setting up
	  the I/O windows and the interrupt mapping, and putting the
	  card and host interface into "Memory and IO" mode.
	*/
	CS_CHECK(RequestConfiguration,
		 pcmcia_request_configuration(link, &link->conf));
	ret = pcmcia_request_configuration(link, &link->conf);
	if (ret)
		goto failed;
	((local_info_t *)link->priv)->eth_dev =
		init_airo_card(link->irq.AssignedIRQ,
			       link->io.BasePort1, 1, &handle_to_dev(link));
	if (!((local_info_t *)link->priv)->eth_dev)
		goto cs_failed;
		goto failed;

	/*
	  At this point, the dev_node_t structure(s) need to be
@@ -368,8 +354,6 @@ static int airo_config(struct pcmcia_device *link)
	kfree(req);
	return 0;

 cs_failed:
	cs_error(link, last_fn, last_ret);
 failed:
	airo_release(link);
	kfree(req);
@@ -386,7 +370,7 @@ static int airo_config(struct pcmcia_device *link)

static void airo_release(struct pcmcia_device *link)
{
	DEBUG(0, "airo_release(0x%p)\n", link);
	dev_dbg(&link->dev, "airo_release\n");
	pcmcia_disable_device(link);
}

+15 −31
Original line number Diff line number Diff line
@@ -55,22 +55,6 @@

#include "atmel.h"

/*
   All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
   you do not define PCMCIA_DEBUG at all, all the debug code will be
   left out.  If you compile with PCMCIA_DEBUG=0, the debug code will
   be present but disabled -- but it can then be enabled for specific
   modules at load time with a 'pc_debug=#' option to insmod.
*/

#ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0);
static char *version = "$Revision: 1.2 $";
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args);
#else
#define DEBUG(n, args...)
#endif

/*====================================================================*/

@@ -155,7 +139,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)
{
	local_info_t *local;

	DEBUG(0, "atmel_attach()\n");
	dev_dbg(&p_dev->dev, "atmel_attach()\n");

	/* Interrupt setup */
	p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
@@ -194,7 +178,7 @@ static int atmel_probe(struct pcmcia_device *p_dev)

static void atmel_detach(struct pcmcia_device *link)
{
	DEBUG(0, "atmel_detach(0x%p)\n", link);
	dev_dbg(&link->dev, "atmel_detach\n");

	atmel_release(link);

@@ -209,9 +193,6 @@ static void atmel_detach(struct pcmcia_device *link)

  ======================================================================*/

#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)

/* Call-back function to interrogate PCMCIA-specific information
   about the current existance of the card */
static int card_present(void *arg)
@@ -275,13 +256,13 @@ static int atmel_config_check(struct pcmcia_device *p_dev,
static int atmel_config(struct pcmcia_device *link)
{
	local_info_t *dev;
	int last_fn, last_ret;
	int ret;
	struct pcmcia_device_id *did;

	dev = link->priv;
	did = dev_get_drvdata(&handle_to_dev(link));

	DEBUG(0, "atmel_config(0x%p)\n", link);
	dev_dbg(&link->dev, "atmel_config\n");

	/*
	  In this loop, we scan the CIS for configuration table entries,
@@ -303,20 +284,25 @@ static int atmel_config(struct pcmcia_device *link)
	  handler to the interrupt, unless the 'Handler' member of the
	  irq structure is initialized.
	*/
	if (link->conf.Attributes & CONF_ENABLE_IRQ)
		CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
	if (link->conf.Attributes & CONF_ENABLE_IRQ) {
		ret = pcmcia_request_irq(link, &link->irq);
		if (ret)
			goto failed;
	}

	/*
	  This actually configures the PCMCIA socket -- setting up
	  the I/O windows and the interrupt mapping, and putting the
	  card and host interface into "Memory and IO" mode.
	*/
	CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
	ret = pcmcia_request_configuration(link, &link->conf);
	if (ret)
		goto failed;

	if (link->irq.AssignedIRQ == 0) {
		printk(KERN_ALERT
		       "atmel: cannot assign IRQ: check that CONFIG_ISA is set in kernel config.");
		goto cs_failed;
		goto failed;
	}

	((local_info_t*)link->priv)->eth_dev =
@@ -327,7 +313,7 @@ static int atmel_config(struct pcmcia_device *link)
				card_present,
				link);
	if (!((local_info_t*)link->priv)->eth_dev)
			goto cs_failed;
			goto failed;


	/*
@@ -340,8 +326,6 @@ static int atmel_config(struct pcmcia_device *link)

	return 0;

 cs_failed:
	cs_error(link, last_fn, last_ret);
 failed:
	atmel_release(link);
	return -ENODEV;
@@ -359,7 +343,7 @@ static void atmel_release(struct pcmcia_device *link)
{
	struct net_device *dev = ((local_info_t*)link->priv)->eth_dev;

	DEBUG(0, "atmel_release(0x%p)\n", link);
	dev_dbg(&link->dev, "atmel_release\n");

	if (dev)
		stop_atmel_card(dev);
+8 −15
Original line number Diff line number Diff line
@@ -510,10 +510,6 @@ static void prism2_detach(struct pcmcia_device *link)
}


#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)


/* run after a CARD_INSERTION event is received to configure the PCMCIA
 * socket and make the device available to the system */

@@ -605,7 +601,6 @@ static int prism2_config(struct pcmcia_device *link)
	struct hostap_interface *iface;
	local_info_t *local;
	int ret = 1;
	int last_fn, last_ret;
	struct hostap_cs_priv *hw_priv;

	PDEBUG(DEBUG_FLOW, "prism2_config()\n");
@@ -617,13 +612,12 @@ static int prism2_config(struct pcmcia_device *link)
	}

	/* Look for an appropriate configuration table entry in the CIS */
	last_ret = pcmcia_loop_config(link, prism2_config_check, NULL);
	if (last_ret) {
	ret = pcmcia_loop_config(link, prism2_config_check, NULL);
	if (ret) {
		if (!ignore_cis_vcc)
			printk(KERN_ERR "GetNextTuple(): No matching "
			       "CIS configuration.  Maybe you need the "
			       "ignore_cis_vcc=1 parameter.\n");
		cs_error(link, RequestIO, last_ret);
		goto failed;
	}

@@ -652,8 +646,9 @@ static int prism2_config(struct pcmcia_device *link)
		link->irq.IRQInfo1 = IRQ_LEVEL_ID;
		link->irq.Handler = prism2_interrupt;
		link->irq.Instance = dev;
		CS_CHECK(RequestIRQ,
			 pcmcia_request_irq(link, &link->irq));
		ret = pcmcia_request_irq(link, &link->irq);
		if (ret)
			goto failed;
	}

	/*
@@ -661,8 +656,9 @@ static int prism2_config(struct pcmcia_device *link)
	 * the I/O windows and the interrupt mapping, and putting the
	 * card and host interface into "Memory and IO" mode.
	 */
	CS_CHECK(RequestConfiguration,
		 pcmcia_request_configuration(link, &link->conf));
	ret = pcmcia_request_configuration(link, &link->conf);
	if (ret)
		goto failed;

	dev->irq = link->irq.AssignedIRQ;
	dev->base_addr = link->io.BasePort1;
@@ -695,9 +691,6 @@ static int prism2_config(struct pcmcia_device *link)
	}
	return ret;

 cs_failed:
	cs_error(link, last_fn, last_ret);

 failed:
	kfree(hw_priv);
	prism2_release((u_long)link);
+36 −52
Original line number Diff line number Diff line
@@ -145,23 +145,6 @@ static const unsigned int txConfEUD = 0x10; /* Enable Uni-Data packets */
static const unsigned int txConfKey    = 0x02; /* Scramble data packets */
static const unsigned int txConfLoop   = 0x01; /* Loopback mode */

/*
   All the PCMCIA modules use PCMCIA_DEBUG to control debugging.  If
   you do not define PCMCIA_DEBUG at all, all the debug code will be
   left out.  If you compile with PCMCIA_DEBUG=0, the debug code will
   be present but disabled -- but it can then be enabled for specific
   modules at load time with a 'pc_debug=#' option to insmod.
*/

#ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0);
#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
static char *version =
"netwave_cs.c 0.3.0 Thu Jul 17 14:36:02 1997 (John Markus Bjørndalen)\n";
#else
#define DEBUG(n, args...)
#endif

/*====================================================================*/

@@ -383,7 +366,7 @@ static int netwave_probe(struct pcmcia_device *link)
    struct net_device *dev;
    netwave_private *priv;

    DEBUG(0, "netwave_attach()\n");
    dev_dbg(&link->dev, "netwave_attach()\n");

    /* Initialize the struct pcmcia_device structure */
    dev = alloc_etherdev(sizeof(netwave_private));
@@ -438,7 +421,7 @@ static void netwave_detach(struct pcmcia_device *link)
{
	struct net_device *dev = link->priv;

	DEBUG(0, "netwave_detach(0x%p)\n", link);
	dev_dbg(&link->dev, "netwave_detach\n");

	netwave_release(link);

@@ -725,18 +708,15 @@ static const struct iw_handler_def netwave_handler_def =
 *
 */

#define CS_CHECK(fn, ret) \
do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)

static int netwave_pcmcia_config(struct pcmcia_device *link) {
    struct net_device *dev = link->priv;
    netwave_private *priv = netdev_priv(dev);
    int i, j, last_ret, last_fn;
    int i, j, ret;
    win_req_t req;
    memreq_t mem;
    u_char __iomem *ramBase = NULL;

    DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link);
    dev_dbg(&link->dev, "netwave_pcmcia_config\n");

    /*
     *  Try allocating IO ports.  This tries a few fixed addresses.
@@ -749,22 +729,24 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
	if (i == 0)
		break;
    }
    if (i != 0) {
	cs_error(link, RequestIO, i);
    if (i != 0)
	goto failed;
    }

    /*
     *  Now allocate an interrupt line.  Note that this does not
     *  actually assign a handler to the interrupt.
     */
    CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
    ret = pcmcia_request_irq(link, &link->irq);
    if (ret)
	    goto failed;

    /*
     *  This actually configures the PCMCIA socket -- setting up
     *  the I/O windows and the interrupt mapping.
     */
    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
    ret = pcmcia_request_configuration(link, &link->conf);
    if (ret)
	    goto failed;

    /*
     *  Allocate a 32K memory window.  Note that the struct pcmcia_device
@@ -772,14 +754,18 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
     *  device needs several windows, you'll need to keep track of
     *  the handles in your private data structure, dev->priv.
     */
    DEBUG(1, "Setting mem speed of %d\n", mem_speed);
    dev_dbg(&link->dev, "Setting mem speed of %d\n", mem_speed);

    req.Attributes = WIN_DATA_WIDTH_8|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
    req.Base = 0; req.Size = 0x8000;
    req.AccessSpeed = mem_speed;
    CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
    ret = pcmcia_request_window(&link, &req, &link->win);
    if (ret)
	    goto failed;
    mem.CardOffset = 0x20000; mem.Page = 0; 
    CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
    ret = pcmcia_map_mem_page(link->win, &mem);
    if (ret)
	    goto failed;

    /* Store base address of the common window frame */
    ramBase = ioremap(req.Base, 0x8000);
@@ -818,8 +804,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
	   get_uint16(ramBase + NETWAVE_EREG_ARW+2));
    return 0;

cs_failed:
    cs_error(link, last_fn, last_ret);
failed:
    netwave_release(link);
    return -ENODEV;
@@ -837,7 +821,7 @@ static void netwave_release(struct pcmcia_device *link)
	struct net_device *dev = link->priv;
	netwave_private *priv = netdev_priv(dev);

	DEBUG(0, "netwave_release(0x%p)\n", link);
	dev_dbg(&link->dev, "netwave_release\n");

	pcmcia_disable_device(link);
	if (link->win)
@@ -892,7 +876,7 @@ static void netwave_reset(struct net_device *dev) {
    u_char __iomem *ramBase = priv->ramBase;
    unsigned int iobase = dev->base_addr;

    DEBUG(0, "netwave_reset: Done with hardware reset\n");
    pr_debug("netwave_reset: Done with hardware reset\n");

    priv->timeoutCounter = 0;

@@ -988,7 +972,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,

    dev->stats.tx_bytes += len;

    DEBUG(3, "Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n",
    pr_debug("Transmitting with SPCQ %x SPU %x LIF %x ISPLQ %x\n",
	  readb(ramBase + NETWAVE_EREG_SPCQ),
	  readb(ramBase + NETWAVE_EREG_SPU),
	  readb(ramBase + NETWAVE_EREG_LIF),
@@ -1000,7 +984,7 @@ static int netwave_hw_xmit(unsigned char* data, int len,
    MaxData    = get_uint16(ramBase + NETWAVE_EREG_TDP+2);
    DataOffset = get_uint16(ramBase + NETWAVE_EREG_TDP+4);
	
    DEBUG(3, "TxFreeList %x, MaxData %x, DataOffset %x\n",
    pr_debug("TxFreeList %x, MaxData %x, DataOffset %x\n",
	  TxFreeList, MaxData, DataOffset);

    /* Copy packet to the adapter fragment buffers */
@@ -1088,7 +1072,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
        status = inb(iobase + NETWAVE_REG_ASR);
		
	if (!pcmcia_dev_present(link)) {
	    DEBUG(1, "netwave_interrupt: Interrupt with status 0x%x "
	    pr_debug("netwave_interrupt: Interrupt with status 0x%x "
		  "from removed or suspended card!\n", status);
	    break;
	}
@@ -1132,7 +1116,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
	    int txStatus;

	    txStatus = readb(ramBase + NETWAVE_EREG_TSER);
	    DEBUG(3, "Transmit done. TSER = %x id %x\n", 
	    pr_debug("Transmit done. TSER = %x id %x\n",
		  txStatus, readb(ramBase + NETWAVE_EREG_TSER + 1));
	    
	    if (txStatus & 0x20) {
@@ -1156,7 +1140,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
		 *      TxGU and TxNOAP is set. (Those are the only ones
		 *      to set TxErr).
		 */
		DEBUG(3, "netwave_interrupt: TxDN with error status %x\n", 
		pr_debug("netwave_interrupt: TxDN with error status %x\n",
		      txStatus);
		
		/* Clear out TxGU, TxNOAP, TxErr and TxTrys */
@@ -1164,7 +1148,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
		writeb(0xdf & txStatus, ramBase+NETWAVE_EREG_TSER+4);
		++dev->stats.tx_errors;
	    }
	    DEBUG(3, "New status is TSER %x ASR %x\n",
	    pr_debug("New status is TSER %x ASR %x\n",
		  readb(ramBase + NETWAVE_EREG_TSER),
		  inb(iobase + NETWAVE_REG_ASR));

@@ -1172,7 +1156,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
	}
	/* TxBA, this would trigger on all error packets received */
	/* if (status & 0x01) {
	   DEBUG(4, "Transmit buffers available, %x\n", status);
	   pr_debug("Transmit buffers available, %x\n", status);
	   }
	   */
    }
@@ -1190,7 +1174,7 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
 */
static void netwave_watchdog(struct net_device *dev) {

    DEBUG(1, "%s: netwave_watchdog: watchdog timer expired\n", dev->name);
    pr_debug("%s: netwave_watchdog: watchdog timer expired\n", dev->name);
    netwave_reset(dev);
    dev->trans_start = jiffies;
    netif_wake_queue(dev);
@@ -1211,7 +1195,7 @@ static int netwave_rx(struct net_device *dev)
    int i;
    u_char *ptr;
	
    DEBUG(3, "xinw_rx: Receiving ... \n");
    pr_debug("xinw_rx: Receiving ... \n");

    /* Receive max 10 packets for now. */
    for (i = 0; i < 10; i++) {
@@ -1237,7 +1221,7 @@ static int netwave_rx(struct net_device *dev)
		
	skb = dev_alloc_skb(rcvLen+5);
	if (skb == NULL) {
	    DEBUG(1, "netwave_rx: Could not allocate an sk_buff of "
	    pr_debug("netwave_rx: Could not allocate an sk_buff of "
		  "length %d\n", rcvLen);
	    ++dev->stats.rx_dropped;
	    /* Tell the adapter to skip the packet */
@@ -1279,7 +1263,7 @@ static int netwave_rx(struct net_device *dev)
	wait_WOC(iobase);
	writeb(NETWAVE_CMD_SRP, ramBase + NETWAVE_EREG_CB + 0);
	writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
	DEBUG(3, "Packet reception ok\n");
	pr_debug("Packet reception ok\n");
    }
    return 0;
}
@@ -1288,7 +1272,7 @@ static int netwave_open(struct net_device *dev) {
    netwave_private *priv = netdev_priv(dev);
    struct pcmcia_device *link = priv->p_dev;

    DEBUG(1, "netwave_open: starting.\n");
    dev_dbg(&link->dev, "netwave_open: starting.\n");
    
    if (!pcmcia_dev_present(link))
	return -ENODEV;
@@ -1305,7 +1289,7 @@ static int netwave_close(struct net_device *dev) {
    netwave_private *priv = netdev_priv(dev);
    struct pcmcia_device *link = priv->p_dev;

    DEBUG(1, "netwave_close: finishing.\n");
    dev_dbg(&link->dev, "netwave_close: finishing.\n");

    link->open--;
    netif_stop_queue(dev);
@@ -1358,11 +1342,11 @@ static void set_multicast_list(struct net_device *dev)
    u_char  rcvMode = 0;
   
#ifdef PCMCIA_DEBUG
    if (pc_debug > 2) {
	static int old;
    {
	xstatic int old;
	if (old != dev->mc_count) {
	    old = dev->mc_count;
	    DEBUG(0, "%s: setting Rx mode to %d addresses.\n",
	    pr_debug("%s: setting Rx mode to %d addresses.\n",
		  dev->name, dev->mc_count);
	}
    }
+10 −17
Original line number Diff line number Diff line
@@ -160,12 +160,6 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
 * device available to the system.
 */

#define CS_CHECK(fn, ret) do { \
	last_fn = (fn); \
	if ((last_ret = (ret)) != 0) \
		goto cs_failed; \
} while (0)

static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
				   cistpl_cftable_entry_t *cfg,
				   cistpl_cftable_entry_t *dflt,
@@ -240,7 +234,7 @@ orinoco_cs_config(struct pcmcia_device *link)
	struct orinoco_private *priv = link->priv;
	struct orinoco_pccard *card = priv->card;
	hermes_t *hw = &priv->hw;
	int last_fn, last_ret;
	int ret;
	void __iomem *mem;

	/*
@@ -257,13 +251,12 @@ orinoco_cs_config(struct pcmcia_device *link)
	 * and most client drivers will only use the CIS to fill in
	 * implementation-defined details.
	 */
	last_ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
	if (last_ret) {
	ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
	if (ret) {
		if (!ignore_cis_vcc)
			printk(KERN_ERR PFX "GetNextTuple(): No matching "
			       "CIS configuration.  Maybe you need the "
			       "ignore_cis_vcc=1 parameter.\n");
		cs_error(link, RequestIO, last_ret);
		goto failed;
	}

@@ -272,14 +265,16 @@ orinoco_cs_config(struct pcmcia_device *link)
	 * a handler to the interrupt, unless the 'Handler' member of
	 * the irq structure is initialized.
	 */
	CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
	ret = pcmcia_request_irq(link, &link->irq);
	if (ret)
		goto failed;

	/* We initialize the hermes structure before completing PCMCIA
	 * configuration just in case the interrupt handler gets
	 * called. */
	mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
	if (!mem)
		goto cs_failed;
		goto failed;

	hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING);

@@ -288,8 +283,9 @@ orinoco_cs_config(struct pcmcia_device *link)
	 * the I/O windows and the interrupt mapping, and putting the
	 * card and host interface into "Memory and IO" mode.
	 */
	CS_CHECK(RequestConfiguration,
		 pcmcia_request_configuration(link, &link->conf));
	ret = pcmcia_request_configuration(link, &link->conf);
	if (ret)
		goto failed;

	/* Ok, we have the configuration, prepare to register the netdev */
	card->node.major = card->node.minor = 0;
@@ -315,9 +311,6 @@ orinoco_cs_config(struct pcmcia_device *link)
				       * net_device has been registered */
	return 0;

 cs_failed:
	cs_error(link, last_fn, last_ret);

 failed:
	orinoco_cs_release(link);
	return -ENODEV;
Loading