Commit 301d0dc6 authored by Dominik Brodowski's avatar Dominik Brodowski Committed by Linus Torvalds

[PATCH] pcmcia: SET_NETDEV for network devices

This patch updates pcmcia network drivers so that their class devices are
linked to the correct physical device.  Based on an patch by Adam Belay, but
adapted to a different pcmcia driver model implementation.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1a0bf3c2
...@@ -519,6 +519,7 @@ static void tc574_config(dev_link_t *link) ...@@ -519,6 +519,7 @@ static void tc574_config(dev_link_t *link)
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
link->dev = &lp->node; link->dev = &lp->node;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n");
......
...@@ -391,6 +391,7 @@ static void tc589_config(dev_link_t *link) ...@@ -391,6 +391,7 @@ static void tc589_config(dev_link_t *link)
link->dev = &lp->node; link->dev = &lp->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_ERR "3c589_cs: register_netdev() failed\n"); printk(KERN_ERR "3c589_cs: register_netdev() failed\n");
......
...@@ -458,6 +458,7 @@ static void axnet_config(dev_link_t *link) ...@@ -458,6 +458,7 @@ static void axnet_config(dev_link_t *link)
info->phy_id = (i < 32) ? i : -1; info->phy_id = (i < 32) ? i : -1;
link->dev = &info->node; link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n"); printk(KERN_NOTICE "axnet_cs: register_netdev() failed\n");
......
...@@ -394,6 +394,7 @@ static void com20020_config(dev_link_t *link) ...@@ -394,6 +394,7 @@ static void com20020_config(dev_link_t *link)
link->dev = &info->node; link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
i = com20020_found(dev, 0); /* calls register_netdev */ i = com20020_found(dev, 0); /* calls register_netdev */
......
...@@ -591,6 +591,7 @@ static void fmvj18x_config(dev_link_t *link) ...@@ -591,6 +591,7 @@ static void fmvj18x_config(dev_link_t *link)
lp->cardtype = cardtype; lp->cardtype = cardtype;
link->dev = &lp->node; link->dev = &lp->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n"); printk(KERN_NOTICE "fmvj18x_cs: register_netdev() failed\n");
......
...@@ -366,6 +366,7 @@ static void ibmtr_config(dev_link_t *link) ...@@ -366,6 +366,7 @@ static void ibmtr_config(dev_link_t *link)
link->dev = &info->node; link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
i = ibmtr_probe_card(dev); i = ibmtr_probe_card(dev);
if (i != 0) { if (i != 0) {
......
...@@ -775,6 +775,7 @@ static void nmclan_config(dev_link_t *link) ...@@ -775,6 +775,7 @@ static void nmclan_config(dev_link_t *link)
link->dev = &lp->node; link->dev = &lp->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
i = register_netdev(dev); i = register_netdev(dev);
if (i != 0) { if (i != 0) {
......
...@@ -722,6 +722,7 @@ static void pcnet_config(dev_link_t *link) ...@@ -722,6 +722,7 @@ static void pcnet_config(dev_link_t *link)
link->dev = &info->node; link->dev = &info->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = ei_poll; dev->poll_controller = ei_poll;
......
...@@ -1024,6 +1024,7 @@ static void smc91c92_config(dev_link_t *link) ...@@ -1024,6 +1024,7 @@ static void smc91c92_config(dev_link_t *link)
link->dev = &smc->node; link->dev = &smc->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if (register_netdev(dev) != 0) { if (register_netdev(dev) != 0) {
printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n"); printk(KERN_ERR "smc91c92_cs: register_netdev() failed\n");
......
...@@ -1121,6 +1121,7 @@ xirc2ps_config(dev_link_t * link) ...@@ -1121,6 +1121,7 @@ xirc2ps_config(dev_link_t * link)
link->dev = &local->node; link->dev = &local->node;
link->state &= ~DEV_CONFIG_PENDING; link->state &= ~DEV_CONFIG_PENDING;
SET_NETDEV_DEV(dev, &handle_to_dev(handle));
if ((err=register_netdev(dev))) { if ((err=register_netdev(dev))) {
printk(KNOT_XIRC "register_netdev() failed\n"); printk(KNOT_XIRC "register_netdev() failed\n");
......
...@@ -178,6 +178,7 @@ struct pcmcia_device { ...@@ -178,6 +178,7 @@ struct pcmcia_device {
#define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv)
#define handle_to_pdev(handle) container_of(handle, struct pcmcia_device, client); #define handle_to_pdev(handle) container_of(handle, struct pcmcia_device, client);
#define handle_to_dev(handle) ((container_of(handle, struct pcmcia_device, client))->dev)
/* error reporting */ /* error reporting */
void cs_error(client_handle_t handle, int func, int ret); void cs_error(client_handle_t handle, int func, int ret);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment