pcmcia: do not initialize the present flag too late.
authorDominik Brodowski <linux@dominikbrodowski.net>
Sat, 19 Jun 2010 12:33:56 +0000 (14:33 +0200)
committerDominik Brodowski <linux@dominikbrodowski.net>
Mon, 5 Jul 2010 10:37:48 +0000 (12:37 +0200)
The "present" flag was initialized too late -- possibly, a card
was already registered at this time, so re-setting the flag to 0
caused pcmcia_dev_present() to fail.

Reported-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
drivers/pcmcia/ds.c

index 9fc3398455388d04159ca1f43ac2524d3c143c01..eac961463be2db5b4013e152e1ede2bccf85c1d2 100644 (file)
@@ -1356,6 +1356,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev,
        INIT_LIST_HEAD(&socket->devices_list);
        memset(&socket->pcmcia_state, 0, sizeof(u8));
        socket->device_count = 0;
+       atomic_set(&socket->present, 0);
 
        ret = pccard_register_pcmcia(socket, &pcmcia_bus_callback);
        if (ret) {
@@ -1364,8 +1365,6 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev,
                return ret;
        }
 
-       atomic_set(&socket->present, 0);
-
        return 0;
 }