aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-04-30 17:43:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-16 00:30:27 -0400
commitf3e7a7b64a79a3d82835ce83fb32616df762d456 (patch)
treeb0879a9a7ba01ac4f0d7f55ddab891efee0af659 /drivers/pcmcia/ds.c
parent8952f593ea66bff4a30f9e641dc6c79832ca64cf (diff)
pcmcia: remove driver_data direct access of struct device
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@lists.infradead.org Cc: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 8f2bb01b098f..304ff6d5cf3b 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -394,7 +394,7 @@ static int pcmcia_device_probe(struct device * dev)
394 p_drv = to_pcmcia_drv(dev->driver); 394 p_drv = to_pcmcia_drv(dev->driver);
395 s = p_dev->socket; 395 s = p_dev->socket;
396 396
397 /* The PCMCIA code passes the match data in via dev->driver_data 397 /* The PCMCIA code passes the match data in via dev_set_drvdata(dev)
398 * which is an ugly hack. Once the driver probe is called it may 398 * which is an ugly hack. Once the driver probe is called it may
399 * and often will overwrite the match data so we must save it first 399 * and often will overwrite the match data so we must save it first
400 * 400 *
@@ -404,7 +404,7 @@ static int pcmcia_device_probe(struct device * dev)
404 * call which will then check whether there are two 404 * call which will then check whether there are two
405 * pseudo devices, and if not, add the second one. 405 * pseudo devices, and if not, add the second one.
406 */ 406 */
407 did = p_dev->dev.driver_data; 407 did = dev_get_drvdata(&p_dev->dev);
408 408
409 ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name); 409 ds_dev_dbg(1, dev, "trying to bind to %s\n", p_drv->drv.name);
410 410
@@ -499,7 +499,7 @@ static int pcmcia_device_remove(struct device * dev)
499 * pseudo multi-function card, we need to unbind 499 * pseudo multi-function card, we need to unbind
500 * all devices 500 * all devices
501 */ 501 */
502 did = p_dev->dev.driver_data; 502 did = dev_get_drvdata(&p_dev->dev);
503 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && 503 if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) &&
504 (p_dev->socket->device_count != 0) && 504 (p_dev->socket->device_count != 0) &&
505 (p_dev->device_no == 0)) 505 (p_dev->device_no == 0))
@@ -978,7 +978,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
978 return 0; 978 return 0;
979 } 979 }
980 980
981 dev->dev.driver_data = (void *) did; 981 dev_set_drvdata(&dev->dev, did);
982 982
983 return 1; 983 return 1;
984} 984}