]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] pcmcia: match "anonymous" cards
authorDominik Brodowski <linux@dominikbrodowski.net>
Mon, 27 Jun 2005 23:28:09 +0000 (16:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 28 Jun 2005 01:03:07 +0000 (18:03 -0700)
If a card doesn't provide _any_ information about itself, assume it is a
so-called "anonymous" card.  pcmciamtd will bind to it if it is configured to
do so.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pcmcia/ds.c
include/linux/mod_devicetable.h

index f657a2a77b2b521f01c026357c168636cde582d1..66680699e9133f97297480512cc2328838ec1f95 100644 (file)
@@ -746,6 +746,15 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
                }
        }
 
+       if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
+               int i;
+               for (i=0; i<4; i++)
+                       if (dev->prod_id[i])
+                               return 0;
+               if (dev->has_manf_id || dev->has_card_id || dev->has_func_id)
+                       return 0;
+       }
+
        dev->dev.driver_data = (void *) did;
 
        return 1;
index c0106d68bb6d6771b0ee4ea5d45136fb295cd292..8a8dc82a941de4bac4ae274f4dbbbad038fa0e74 100644 (file)
@@ -209,5 +209,6 @@ struct pcmcia_device_id {
 #define PCMCIA_DEV_ID_MATCH_PROD_ID4   0x0080
 #define PCMCIA_DEV_ID_MATCH_DEVICE_NO  0x0100
 #define PCMCIA_DEV_ID_MATCH_FAKE_CIS   0x0200
+#define PCMCIA_DEV_ID_MATCH_ANONYMOUS  0x0400
 
 #endif /* LINUX_MOD_DEVICETABLE_H */