diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-05 12:45:09 +0300 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 19:15:57 +0400 |
commit | fd238232cd0ff4840ae6946bb338502154096d88 (patch) | |
tree | d20e8f5871f7cff9d0867a84f6ba088fbffcbe28 /drivers/pcmcia | |
parent | a78f4dd331a4f6a396eb5849656a4a72a70a56d7 (diff) | |
download | linux-fd238232cd0ff4840ae6946bb338502154096d88.tar.xz |
[PATCH] pcmcia: embed dev_link_t into struct pcmcia_device
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 19 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_ioctl.c | 9 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 13 |
3 files changed, 17 insertions, 24 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 488448a12b2f..4ab956843d86 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -391,6 +391,7 @@ static int pcmcia_device_probe(struct device * dev) } p_dev->p_state &= ~CLIENT_UNBOUND; + p_dev->handle = p_dev; ret = p_drv->probe(p_dev); if (ret) @@ -1039,12 +1040,10 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) ret = p_drv->suspend(p_dev); if (ret) return ret; - if (p_dev->instance) { - p_dev->instance->state |= DEV_SUSPEND; - if ((p_dev->instance->state & DEV_CONFIG) && - !(p_dev->instance->state & DEV_SUSPEND_NORELEASE)) + p_dev->state |= DEV_SUSPEND; + if ((p_dev->state & DEV_CONFIG) && + !(p_dev->state & DEV_SUSPEND_NORELEASE)) pcmcia_release_configuration(p_dev); - } } return 0; @@ -1061,16 +1060,14 @@ static int pcmcia_dev_resume(struct device * dev) p_drv = to_pcmcia_drv(dev->driver); if (p_drv && p_drv->resume) { - if (p_dev->instance) { - p_dev->instance->state &= ~DEV_SUSPEND; - if ((p_dev->instance->state & DEV_CONFIG) && - !(p_dev->instance->state & DEV_SUSPEND_NORELEASE)){ + p_dev->state &= ~DEV_SUSPEND; + if ((p_dev->state & DEV_CONFIG) && + !(p_dev->state & DEV_SUSPEND_NORELEASE)){ ret = pcmcia_request_configuration(p_dev, - &p_dev->instance->conf); + &p_dev->conf); if (ret) return ret; } - } return p_drv->resume(p_dev); } diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index be08bc9e99fd..2b11a332175e 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c @@ -229,7 +229,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info) * by userspace before, we need to * return the "instance". */ spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); - bind_info->instance = p_dev->instance; + bind_info->instance = p_dev; ret = -EBUSY; goto err_put_module; } else { @@ -358,16 +358,15 @@ static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int found: spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); - if ((!p_dev->instance) || - (p_dev->instance->state & DEV_CONFIG_PENDING)) { + if (p_dev->state & DEV_CONFIG_PENDING) { ret = -EAGAIN; goto err_put; } if (first) - node = p_dev->instance->dev; + node = p_dev->dev_node; else - for (node = p_dev->instance->dev; node; node = node->next) + for (node = p_dev->dev_node; node; node = node->next) if (node == bind_info->next) break; if (!node) { diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index ab0bbb6207b2..93ab9402d37f 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c @@ -942,15 +942,12 @@ int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_h EXPORT_SYMBOL(pcmcia_request_window); void pcmcia_disable_device(struct pcmcia_device *p_dev) { - if (!p_dev->instance) - return; - pcmcia_release_configuration(p_dev); - pcmcia_release_io(p_dev, &p_dev->instance->io); - pcmcia_release_irq(p_dev, &p_dev->instance->irq); - if (&p_dev->instance->win) - pcmcia_release_window(p_dev->instance->win); + pcmcia_release_io(p_dev, &p_dev->io); + pcmcia_release_irq(p_dev, &p_dev->irq); + if (&p_dev->win) + pcmcia_release_window(p_dev->win); - p_dev->instance->dev = NULL; + p_dev->dev_node = NULL; } EXPORT_SYMBOL(pcmcia_disable_device); |