Skip to content

Commit

Permalink
[SERIAL] serial_cs: allow wildcarded quirks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Russell King authored and Russell King committed Oct 1, 2006
1 parent 1fbbac4 commit a8244b5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions drivers/serial/serial_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ module_param(buggy_uart, int, 0444);
/* Table of multi-port card ID's */

struct serial_quirk {
u_short manfid;
u_short prodid;
unsigned int manfid;
unsigned int prodid;
int multi; /* 1 = multifunction, > 1 = # ports */
};

Expand Down Expand Up @@ -645,9 +645,12 @@ static int serial_config(struct pcmcia_device * link)
if (first_tuple(link, tuple, parse) == CS_SUCCESS) {
info->manfid = parse->manfid.manf;
info->prodid = parse->manfid.card;

for (i = 0; i < ARRAY_SIZE(quirks); i++)
if ((info->manfid == quirks[i].manfid) &&
(info->prodid == quirks[i].prodid)) {
if ((quirks[i].manfid == ~0 ||
quirks[i].manfid == info->manfid) &&
(quirks[i].prodid == ~0 ||
quirks[i].prodid == info->prodid)) {
info->quirk = &quirks[i];
break;
}
Expand Down

0 comments on commit a8244b5

Please sign in to comment.