{
struct net_device *dev;
struct wl_private *lp;
+ int ret;
/*--------------------------------------------------------------------*/
DBG_FUNC("wl_adapter_attach");
lp = wl_priv(dev);
lp->link = link;
- wl_adapter_insert(link);
+ ret = wl_adapter_insert(link);
+ if (ret != 0)
+ wl_device_dealloc(dev);
DBG_LEAVE(DbgInfo);
- return 0;
+ return ret;
} /* wl_adapter_attach */
/*============================================================================*/
return 0;
} /* wl_adapter_resume */
-void wl_adapter_insert(struct pcmcia_device *link)
+int wl_adapter_insert(struct pcmcia_device *link)
{
struct net_device *dev;
int ret;
" %pM\n", dev->name, dev->base_addr, dev->irq, dev->dev_addr);
DBG_LEAVE(DbgInfo);
- return;
+ return 0;
failed:
wl_adapter_release(link);
DBG_LEAVE(DbgInfo);
- return;
+ return ret;
} /* wl_adapter_insert */
/*============================================================================*/
/*******************************************************************************
- * function protoypes
+ * function prototypes
******************************************************************************/
-void wl_adapter_insert(struct pcmcia_device *link);
+int wl_adapter_insert(struct pcmcia_device *link);
void wl_adapter_release(struct pcmcia_device *link);