aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 47cab31ff6e4..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))
@@ -828,7 +828,6 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
828{ 828{
829 struct pcmcia_socket *s = dev->socket; 829 struct pcmcia_socket *s = dev->socket;
830 const struct firmware *fw; 830 const struct firmware *fw;
831 char path[FIRMWARE_NAME_MAX];
832 int ret = -ENOMEM; 831 int ret = -ENOMEM;
833 int no_funcs; 832 int no_funcs;
834 int old_funcs; 833 int old_funcs;
@@ -839,16 +838,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
839 838
840 ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename); 839 ds_dev_dbg(1, &dev->dev, "trying to load CIS file %s\n", filename);
841 840
842 if (strlen(filename) > (FIRMWARE_NAME_MAX - 1)) { 841 if (request_firmware(&fw, filename, &dev->dev) == 0) {
843 dev_printk(KERN_WARNING, &dev->dev,
844 "pcmcia: CIS filename is too long [%s]\n",
845 filename);
846 return -EINVAL;
847 }
848
849 snprintf(path, sizeof(path), "%s", filename);
850
851 if (request_firmware(&fw, path, &dev->dev) == 0) {
852 if (fw->size >= CISTPL_MAX_CIS_SIZE) { 842 if (fw->size >= CISTPL_MAX_CIS_SIZE) {
853 ret = -EINVAL; 843 ret = -EINVAL;
854 dev_printk(KERN_ERR, &dev->dev, 844 dev_printk(KERN_ERR, &dev->dev,
@@ -988,7 +978,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
988 return 0; 978 return 0;
989 } 979 }
990 980
991 dev->dev.driver_data = (void *) did; 981 dev_set_drvdata(&dev->dev, did);
992 982
993 return 1; 983 return 1;
994} 984}