提交 cb108619 编写于 作者: M Michael Grzeschik 提交者: David S. Miller

arcnet: com20020-pci: fix dev_id calculation

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: NMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0d494fcf
...@@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev, ...@@ -135,6 +135,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
for (i = 0; i < ci->devcount; i++) { for (i = 0; i < ci->devcount; i++) {
struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i]; struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
struct com20020_dev *card; struct com20020_dev *card;
int dev_id_mask = 0xf;
dev = alloc_arcdev(device); dev = alloc_arcdev(device);
if (!dev) { if (!dev) {
...@@ -179,8 +180,8 @@ static int com20020pci_probe(struct pci_dev *pdev, ...@@ -179,8 +180,8 @@ static int com20020pci_probe(struct pci_dev *pdev,
/* Get the dev_id from the PLX rotary coder */ /* Get the dev_id from the PLX rotary coder */
if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15)) if (!strncmp(ci->name, "EAE PLX-PCI MA1", 15))
dev->dev_id = 0xc; dev_id_mask = 0x3;
dev->dev_id ^= inb(priv->misc + ci->rotary) >> 4; 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); snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册