Skip to content

Commit

Permalink
arcnet: com20020-pci: fix dev_id calculation
Browse files Browse the repository at this point in the history
The dev_id was miscalculated. Only the two bits 4-5 are relevant for the
MA1 card. PCIARC1 and PCIFB2 use the four bits 4-7 for id selection.

Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mgrzeschik authored and davem330 committed Jun 29, 2017
1 parent 0d494fc commit cb10861
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/arcnet/com20020-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
for (i = 0; i < ci->devcount; i++) {
struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
struct com20020_dev *card;
int dev_id_mask = 0xf;

dev = alloc_arcdev(device);
if (!dev) {
Expand Down Expand Up @@ -179,8 +180,8 @@ static int com20020pci_probe(struct pci_dev *pdev,

/* Get the dev_id from the PLX rotary coder */
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
dev->dev_id = 0xc;
dev->dev_id ^= inb(priv->misc + ci->rotary) >> 4;
dev_id_mask = 0x3;
dev->dev_id = (inb(priv->misc + ci->rotary) >> 4) & dev_id_mask;

snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);

Expand Down

0 comments on commit cb10861

Please sign in to comment.