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>

authored by Alexander Kurz and committed by Dominik Brodowski 83bf6f11 04de0816

+4 -3
+4 -3
drivers/pcmcia/ds.c
··· 820 } 821 822 if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { 823 - if (dev->device_no != did->device_no) 824 - return 0; 825 mutex_lock(&dev->socket->ops_mutex); 826 dev->socket->pcmcia_state.has_pfc = 1; 827 mutex_unlock(&dev->socket->ops_mutex); 828 } 829 830 if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) { ··· 836 837 /* if this is a pseudo-multi-function device, 838 * we need explicit matches */ 839 - if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) 840 return 0; 841 if (dev->device_no) 842 return 0;
··· 820 } 821 822 if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { 823 + dev_dbg(&dev->dev, "this is a pseudo-multi-function device\n"); 824 mutex_lock(&dev->socket->ops_mutex); 825 dev->socket->pcmcia_state.has_pfc = 1; 826 mutex_unlock(&dev->socket->ops_mutex); 827 + if (dev->device_no != did->device_no) 828 + return 0; 829 } 830 831 if (did->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID) { ··· 835 836 /* if this is a pseudo-multi-function device, 837 * we need explicit matches */ 838 + if (dev->socket->pcmcia_state.has_pfc) 839 return 0; 840 if (dev->device_no) 841 return 0;