forked from Minki/linux
[SERIAL] serial_cs: allow wildcarded quirks
Some quirks we will introduce next apply to (eg) all cards of one manufacturer. Therefore, we need a way to list these in the quirk table - use ~0 - this is not a possible device ID value. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
1fbbac4bcb
commit
a8244b564c
@ -81,8 +81,8 @@ module_param(buggy_uart, int, 0444);
|
|||||||
/* Table of multi-port card ID's */
|
/* Table of multi-port card ID's */
|
||||||
|
|
||||||
struct serial_quirk {
|
struct serial_quirk {
|
||||||
u_short manfid;
|
unsigned int manfid;
|
||||||
u_short prodid;
|
unsigned int prodid;
|
||||||
int multi; /* 1 = multifunction, > 1 = # ports */
|
int multi; /* 1 = multifunction, > 1 = # ports */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -645,9 +645,12 @@ static int serial_config(struct pcmcia_device * link)
|
|||||||
if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
|
if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
|
||||||
info->manfid = parse->manfid.manf;
|
info->manfid = parse->manfid.manf;
|
||||||
info->prodid = parse->manfid.card;
|
info->prodid = parse->manfid.card;
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(quirks); i++)
|
for (i = 0; i < ARRAY_SIZE(quirks); i++)
|
||||||
if ((info->manfid == quirks[i].manfid) &&
|
if ((quirks[i].manfid == ~0 ||
|
||||||
(info->prodid == quirks[i].prodid)) {
|
quirks[i].manfid == info->manfid) &&
|
||||||
|
(quirks[i].prodid == ~0 ||
|
||||||
|
quirks[i].prodid == info->prodid)) {
|
||||||
info->quirk = &quirks[i];
|
info->quirk = &quirks[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user