diff options
author | Alexander Kurz <linux@kbdbabel.org> | 2010-04-25 13:44:35 +0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-04-26 20:09:07 +0200 |
commit | 83bf6f11e82eba8533f8dbd241b2c2825e42ae5d (patch) | |
tree | 99e30a2ea81ae4dd5bad9120e0698014f51ca0a4 /drivers/pcmcia | |
parent | 04de0816173c86948b75da93a6344a0a02bbec4d (diff) | |
download | blackbird-op-linux-83bf6f11e82eba8533f8dbd241b2c2825e42ae5d.tar.gz blackbird-op-linux-83bf6f11e82eba8533f8dbd241b2c2825e42ae5d.zip |
pcmcia: fix matching rules for pseudo-multi-function cards
Prevent PCMCIA_DEV_ID_MATCH_FUNC_ID from grabbing PFC-cards:
I changed the code, so that the first matching struct
pcmcia_device_id _PFC_ entry will mark the card has_pfc,
preventing PCMCIA_DEV_ID_MATCH_FUNC_ID to match.
[linux-pcmcia@lists.infradead.org: re-order commit message]
Signed-off-by: Alexander Kurz <linux@kbdbabel.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r-- | drivers/pcmcia/ds.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 92a5af8aa0b4..508f94a2a78d 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -820,11 +820,12 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, } if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { - if (dev->device_no != did->device_no) - return 0; + dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n"); mutex_lock(&dev->socket->ops_mutex); dev->socket->pcmcia_state.has_pfc = 1; mutex_unlock(&dev->socket->ops_mutex); + if (dev->device_no != did->device_no) + return 0; } if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) { @@ -835,7 +836,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, /* if this is a pseudo-multi-function device, * we need explicit matches */ - if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) + if (dev->socket->pcmcia_state.has_pfc) return 0; if (dev->device_no) return 0; |