aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/ds.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-06-27 19:28:17 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 21:03:08 -0400
commite2f0b5344161dabfab102ac0a54f330f61477972 (patch)
tree74ecdbd6bd7e875c56f78a5a1d7822ade2159794 /drivers/pcmcia/ds.c
parente94e15f70559962f60915a09d44658b73a453fe2 (diff)
[PATCH] pcmcia: rescan bus always upon echoing into setup_done
Always rescan the devices upon echo'ing something to available_resources_setup_done. This is needed for proper "coldplug" support. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/pcmcia/ds.c')
-rw-r--r--drivers/pcmcia/ds.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 0de0f2300457..bde9b0513d92 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -717,9 +717,42 @@ static inline void pcmcia_add_pseudo_device(struct pcmcia_bus_socket *s)
717 return; 717 return;
718} 718}
719 719
720static void pcmcia_bus_rescan(void) 720static int pcmcia_requery(struct device *dev, void * _data)
721{ 721{
722 struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
723 if (!p_dev->dev.driver)
724 pcmcia_device_query(p_dev);
725
726 return 0;
727}
728
729static void pcmcia_bus_rescan(struct pcmcia_socket *skt)
730{
731 int no_devices=0;
732 unsigned long flags;
733
722 /* must be called with skt_sem held */ 734 /* must be called with skt_sem held */
735 spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
736 if (list_empty(&skt->pcmcia->devices_list))
737 no_devices=1;
738 spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
739
740 /* if no devices were added for this socket yet because of
741 * missing resource information or other trouble, we need to
742 * do this now. */
743 if (no_devices) {
744 int ret = pcmcia_card_add(skt);
745 if (ret)
746 return;
747 }
748
749 /* some device information might have changed because of a CIS
750 * update or because we can finally read it correctly... so
751 * determine it again, overwriting old values if necessary. */
752 bus_for_each_dev(&pcmcia_bus_type, NULL, NULL, pcmcia_requery);
753
754 /* we re-scan all devices, not just the ones connected to this
755 * socket. This does not matter, though. */
723 bus_rescan_devices(&pcmcia_bus_type); 756 bus_rescan_devices(&pcmcia_bus_type);
724} 757}
725 758
@@ -1861,8 +1894,7 @@ static int __devinit pcmcia_bus_add_socket(struct class_device *class_dev)
1861 /* Set up hotline to Card Services */ 1894 /* Set up hotline to Card Services */
1862 s->callback.owner = THIS_MODULE; 1895 s->callback.owner = THIS_MODULE;
1863 s->callback.event = &ds_event; 1896 s->callback.event = &ds_event;
1864 s->callback.resources_done = &pcmcia_card_add; 1897 s->callback.requery = &pcmcia_bus_rescan;
1865 s->callback.replace_cis = &pcmcia_bus_rescan;
1866 socket->pcmcia = s; 1898 socket->pcmcia = s;
1867 1899
1868 ret = pccard_register_pcmcia(socket, &s->callback); 1900 ret = pccard_register_pcmcia(socket, &s->callback);