diff options
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 23 | ||||
-rw-r--r-- | drivers/pcmcia/soc_common.c | 6 |
2 files changed, 19 insertions, 10 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 4174d9656e35..34c83d3ca0fa 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -427,6 +427,18 @@ static int pcmcia_device_probe(struct device * dev) | |||
427 | p_drv = to_pcmcia_drv(dev->driver); | 427 | p_drv = to_pcmcia_drv(dev->driver); |
428 | s = p_dev->socket; | 428 | s = p_dev->socket; |
429 | 429 | ||
430 | /* The PCMCIA code passes the match data in via dev->driver_data | ||
431 | * which is an ugly hack. Once the driver probe is called it may | ||
432 | * and often will overwrite the match data so we must save it first | ||
433 | * | ||
434 | * handle pseudo multifunction devices: | ||
435 | * there are at most two pseudo multifunction devices. | ||
436 | * if we're matching against the first, schedule a | ||
437 | * call which will then check whether there are two | ||
438 | * pseudo devices, and if not, add the second one. | ||
439 | */ | ||
440 | did = p_dev->dev.driver_data; | ||
441 | |||
430 | ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, | 442 | ds_dbg(1, "trying to bind %s to %s\n", p_dev->dev.bus_id, |
431 | p_drv->drv.name); | 443 | p_drv->drv.name); |
432 | 444 | ||
@@ -455,21 +467,14 @@ static int pcmcia_device_probe(struct device * dev) | |||
455 | goto put_module; | 467 | goto put_module; |
456 | } | 468 | } |
457 | 469 | ||
458 | /* handle pseudo multifunction devices: | ||
459 | * there are at most two pseudo multifunction devices. | ||
460 | * if we're matching against the first, schedule a | ||
461 | * call which will then check whether there are two | ||
462 | * pseudo devices, and if not, add the second one. | ||
463 | */ | ||
464 | did = p_dev->dev.driver_data; | ||
465 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && | 470 | if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && |
466 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) | 471 | (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) |
467 | pcmcia_add_device_later(p_dev->socket, 0); | 472 | pcmcia_add_device_later(p_dev->socket, 0); |
468 | 473 | ||
469 | put_module: | 474 | put_module: |
470 | if (ret) | 475 | if (ret) |
471 | module_put(p_drv->owner); | 476 | module_put(p_drv->owner); |
472 | put_dev: | 477 | put_dev: |
473 | if (ret) | 478 | if (ret) |
474 | put_device(dev); | 479 | put_device(dev); |
475 | return (ret); | 480 | return (ret); |
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index c48f3f69bdaf..da3972153226 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
@@ -748,7 +748,9 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
748 | 748 | ||
749 | add_timer(&skt->poll_timer); | 749 | add_timer(&skt->poll_timer); |
750 | 750 | ||
751 | device_create_file(&skt->socket.dev, &dev_attr_status); | 751 | ret = device_create_file(&skt->socket.dev, &dev_attr_status); |
752 | if (ret) | ||
753 | goto out_err_8; | ||
752 | } | 754 | } |
753 | 755 | ||
754 | dev_set_drvdata(dev, sinfo); | 756 | dev_set_drvdata(dev, sinfo); |
@@ -758,6 +760,8 @@ int soc_common_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops | |||
758 | do { | 760 | do { |
759 | skt = &sinfo->skt[i]; | 761 | skt = &sinfo->skt[i]; |
760 | 762 | ||
763 | device_remove_file(&skt->socket.dev, &dev_attr_status); | ||
764 | out_err_8: | ||
761 | del_timer_sync(&skt->poll_timer); | 765 | del_timer_sync(&skt->poll_timer); |
762 | pcmcia_unregister_socket(&skt->socket); | 766 | pcmcia_unregister_socket(&skt->socket); |
763 | 767 | ||