[PATCH] pcmcia: remove driver_data direct access of struct device
Greg Kroah-Hartman
gregkh at suse.de
Thu Apr 30 18:20:48 EDT 2009
From: Greg Kroah-Hartman <gregkh at suse.de>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Cc: linux-pcmcia at lists.infradead.org
Cc: Dominik Brodowski <linux at dominikbrodowski.net>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
drivers/pcmcia/ds.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -394,7 +394,7 @@ static int pcmcia_device_probe(struct de
p_drv = to_pcmcia_drv(dev->driver);
s = p_dev->socket;
- /* The PCMCIA code passes the match data in via dev->driver_data
+ /* The PCMCIA code passes the match data in via dev_set_drvdata(dev)
* which is an ugly hack. Once the driver probe is called it may
* and often will overwrite the match data so we must save it first
*
@@ -404,7 +404,7 @@ static int pcmcia_device_probe(struct de
* call which will then check whether there are two
* pseudo devices, and if not, add the second one.
*/
- did = p_dev->dev.driver_data;
+ did = dev_get_drvdata(&p_dev->dev);
ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name);
@@ -499,7 +499,7 @@ static int pcmcia_device_remove(struct d
* pseudo multi-function card, we need to unbind
* all devices
*/
- did = p_dev->dev.driver_data;
+ did = dev_get_drvdata(&p_dev->dev);
if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
(p_dev->socket->device_count != 0) &&
(p_dev->device_no == 0))
@@ -988,7 +988,7 @@ static inline int pcmcia_devmatch(struct
return 0;
}
- dev->dev.driver_data = (void *) did;
+ dev_set_drvdata(&dev->dev, did);
return 1;
}
More information about the linux-pcmcia
mailing list