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