diff options
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r-- | drivers/pcmcia/ds.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 74b3124e8247..0f701921c13e 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c | |||
@@ -717,6 +717,7 @@ static int pcmcia_requery(struct device *dev, void * _data) | |||
717 | static void pcmcia_bus_rescan(struct pcmcia_socket *skt) | 717 | static void pcmcia_bus_rescan(struct pcmcia_socket *skt) |
718 | { | 718 | { |
719 | int no_devices=0; | 719 | int no_devices=0; |
720 | int ret = 0; | ||
720 | unsigned long flags; | 721 | unsigned long flags; |
721 | 722 | ||
722 | /* must be called with skt_mutex held */ | 723 | /* must be called with skt_mutex held */ |
@@ -729,7 +730,7 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt) | |||
729 | * missing resource information or other trouble, we need to | 730 | * missing resource information or other trouble, we need to |
730 | * do this now. */ | 731 | * do this now. */ |
731 | if (no_devices) { | 732 | if (no_devices) { |
732 | int ret = pcmcia_card_add(skt); | 733 | ret = pcmcia_card_add(skt); |
733 | if (ret) | 734 | if (ret) |
734 | return; | 735 | return; |
735 | } | 736 | } |
@@ -741,7 +742,9 @@ static void pcmcia_bus_rescan(struct pcmcia_socket *skt) | |||
741 | 742 | ||
742 | /* we re-scan all devices, not just the ones connected to this | 743 | /* we re-scan all devices, not just the ones connected to this |
743 | * socket. This does not matter, though. */ | 744 | * socket. This does not matter, though. */ |
744 | bus_rescan_devices(&pcmcia_bus_type); | 745 | ret = bus_rescan_devices(&pcmcia_bus_type); |
746 | if (ret) | ||
747 | printk(KERN_INFO "pcmcia: bus_rescan_devices failed\n"); | ||
745 | } | 748 | } |
746 | 749 | ||
747 | static inline int pcmcia_devmatch(struct pcmcia_device *dev, | 750 | static inline int pcmcia_devmatch(struct pcmcia_device *dev, |
@@ -1001,6 +1004,7 @@ static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, | |||
1001 | struct device_attribute *attr, const char *buf, size_t count) | 1004 | struct device_attribute *attr, const char *buf, size_t count) |
1002 | { | 1005 | { |
1003 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); | 1006 | struct pcmcia_device *p_dev = to_pcmcia_dev(dev); |
1007 | int ret; | ||
1004 | 1008 | ||
1005 | if (!count) | 1009 | if (!count) |
1006 | return -EINVAL; | 1010 | return -EINVAL; |
@@ -1009,7 +1013,10 @@ static ssize_t pcmcia_store_allow_func_id_match(struct device *dev, | |||
1009 | p_dev->allow_func_id_match = 1; | 1013 | p_dev->allow_func_id_match = 1; |
1010 | mutex_unlock(&p_dev->socket->skt_mutex); | 1014 | mutex_unlock(&p_dev->socket->skt_mutex); |
1011 | 1015 | ||
1012 | bus_rescan_devices(&pcmcia_bus_type); | 1016 | ret = bus_rescan_devices(&pcmcia_bus_type); |
1017 | if (ret) | ||
1018 | printk(KERN_INFO "pcmcia: bus_rescan_devices failed after " | ||
1019 | "allowing func_id matches\n"); | ||
1013 | 1020 | ||
1014 | return count; | 1021 | return count; |
1015 | } | 1022 | } |
@@ -1292,10 +1299,22 @@ struct bus_type pcmcia_bus_type = { | |||
1292 | 1299 | ||
1293 | static int __init init_pcmcia_bus(void) | 1300 | static int __init init_pcmcia_bus(void) |
1294 | { | 1301 | { |
1302 | int ret; | ||
1303 | |||
1295 | spin_lock_init(&pcmcia_dev_list_lock); | 1304 | spin_lock_init(&pcmcia_dev_list_lock); |
1296 | 1305 | ||
1297 | bus_register(&pcmcia_bus_type); | 1306 | ret = bus_register(&pcmcia_bus_type); |
1298 | class_interface_register(&pcmcia_bus_interface); | 1307 | if (ret < 0) { |
1308 | printk(KERN_WARNING "pcmcia: bus_register error: %d\n", ret); | ||
1309 | return ret; | ||
1310 | } | ||
1311 | ret = class_interface_register(&pcmcia_bus_interface); | ||
1312 | if (ret < 0) { | ||
1313 | printk(KERN_WARNING | ||
1314 | "pcmcia: class_interface_register error: %d\n", ret); | ||
1315 | bus_unregister(&pcmcia_bus_type); | ||
1316 | return ret; | ||
1317 | } | ||
1299 | 1318 | ||
1300 | pcmcia_setup_ioctl(); | 1319 | pcmcia_setup_ioctl(); |
1301 | 1320 | ||