Commit 06675e6f authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle

tc35815: Use irq number for tc35815-mac platform device id

The tc35815-mac platform device used a pci bus number and a devfn to
identify its target device, but the pci bus number may vary if some
bus-bridges are found.  Use irq number which is be unique for embedded
controllers.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 0487de91
......@@ -598,8 +598,8 @@ static int __init rbtx4938_ethaddr_init(void)
printk(KERN_WARNING "seeprom: bad checksum.\n");
}
for (i = 0; i < 2; i++) {
unsigned int slot = TX4938_PCIC_IDSEL_AD_TO_SLOT(31 - i);
unsigned int id = (1 << 8) | PCI_DEVFN(slot, 0); /* bus 1 */
unsigned int id =
TXX9_IRQ_BASE + (i ? TX4938_IR_ETH1 : TX4938_IR_ETH0);
struct platform_device *pdev;
if (!(tx4938_ccfgptr->pcfg &
(i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL)))
......
......@@ -611,7 +611,7 @@ static int __devinit tc35815_mac_match(struct device *dev, void *data)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct pci_dev *pci_dev = data;
unsigned int id = (pci_dev->bus->number << 8) | pci_dev->devfn;
unsigned int id = pci_dev->irq;
return !strcmp(plat_dev->name, "tc35815-mac") && plat_dev->id == id;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment