Commit eb53fa9d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] 3c509 compile fix

Patch from Marc Zyngier <mzyngier@freesurf.fr>

Fix compilation of 3c509.c
parent b789ebfc
...@@ -338,16 +338,6 @@ static int __init el3_common_init (struct net_device *dev) ...@@ -338,16 +338,6 @@ static int __init el3_common_init (struct net_device *dev)
dev->watchdog_timeo = TX_TIMEOUT; dev->watchdog_timeo = TX_TIMEOUT;
dev->do_ioctl = netdev_ioctl; dev->do_ioctl = netdev_ioctl;
#ifdef CONFIG_PM
/* register power management */
lp->pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback);
if (lp->pmdev) {
struct pm_dev *p;
p = lp->pmdev;
p->data = (struct net_device *)dev;
}
#endif
return 0; return 0;
} }
...@@ -417,6 +407,13 @@ static int __init el3_probe(int card_idx) ...@@ -417,6 +407,13 @@ static int __init el3_probe(int card_idx)
phys_addr[j] = phys_addr[j] =
htons(read_eeprom(ioaddr, j)); htons(read_eeprom(ioaddr, j));
if_port = read_eeprom(ioaddr, 8) >> 14; if_port = read_eeprom(ioaddr, 8) >> 14;
if (!(dev = init_etherdev(NULL, sizeof(struct el3_private)))) {
release_region(ioaddr, EL3_IO_EXTENT);
pnp_device_detach(idev);
return -ENOMEM;
}
SET_MODULE_OWNER(dev);
pnp_cards++; pnp_cards++;
goto found; goto found;
} }
...@@ -497,24 +494,29 @@ static int __init el3_probe(int card_idx) ...@@ -497,24 +494,29 @@ static int __init el3_probe(int card_idx)
} }
irq = id_read_eeprom(9) >> 12; irq = id_read_eeprom(9) >> 12;
#if 0 /* Huh ? if (!(dev = init_etherdev(NULL, sizeof(struct el3_private))))
Can someone explain what is this for ? */ return -ENOMEM;
if (dev) { /* Set passed-in IRQ or I/O Addr. */
if (dev->irq > 1 && dev->irq < 16) SET_MODULE_OWNER(dev);
/* Set passed-in IRQ or I/O Addr. */
if (dev->irq > 1 && dev->irq < 16)
irq = dev->irq; irq = dev->irq;
if (dev->base_addr) { if (dev->base_addr) {
if (dev->mem_end == 0x3c509 /* Magic key */ if (dev->mem_end == 0x3c509 /* Magic key */
&& dev->base_addr >= 0x200 && dev->base_addr <= 0x3e0) && dev->base_addr >= 0x200 && dev->base_addr <= 0x3e0)
ioaddr = dev->base_addr & 0x3f0; ioaddr = dev->base_addr & 0x3f0;
else if (dev->base_addr != ioaddr) else if (dev->base_addr != ioaddr) {
return -ENODEV; unregister_netdev (dev);
} return -ENODEV;
}
} }
#endif
if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) {
return -EBUSY; unregister_netdev (dev);
return -EBUSY;
}
/* Set the adaptor tag so that the next card can be found. */ /* Set the adaptor tag so that the next card can be found. */
outb(0xd0 + ++current_tag, id_port); outb(0xd0 + ++current_tag, id_port);
...@@ -524,6 +526,7 @@ static int __init el3_probe(int card_idx) ...@@ -524,6 +526,7 @@ static int __init el3_probe(int card_idx)
EL3WINDOW(0); EL3WINDOW(0);
if (inw(ioaddr) != 0x6d50) { if (inw(ioaddr) != 0x6d50) {
unregister_netdev (dev);
release_region(ioaddr, EL3_IO_EXTENT); release_region(ioaddr, EL3_IO_EXTENT);
return -ENODEV; return -ENODEV;
} }
...@@ -531,12 +534,9 @@ static int __init el3_probe(int card_idx) ...@@ -531,12 +534,9 @@ static int __init el3_probe(int card_idx)
/* Free the interrupt so that some other card can use it. */ /* Free the interrupt so that some other card can use it. */
outw(0x0f00, ioaddr + WN0_IRQ); outw(0x0f00, ioaddr + WN0_IRQ);
dev = init_etherdev(NULL, sizeof(struct el3_private)); #ifdef __ISAPNP__
if (dev == NULL) { found: /* PNP jumps here... */
release_region(ioaddr, EL3_IO_EXTENT); #endif /* __ISAPNP__ */
return -ENOMEM;
}
SET_MODULE_OWNER(dev);
memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr)); memcpy(dev->dev_addr, phys_addr, sizeof(phys_addr));
dev->base_addr = ioaddr; dev->base_addr = ioaddr;
...@@ -547,6 +547,16 @@ static int __init el3_probe(int card_idx) ...@@ -547,6 +547,16 @@ static int __init el3_probe(int card_idx)
lp->dev = &idev->dev; lp->dev = &idev->dev;
#endif #endif
#ifdef CONFIG_PM
/* register power management */
lp->pmdev = pm_register(PM_ISA_DEV, card_idx, el3_pm_callback);
if (lp->pmdev) {
struct pm_dev *p;
p = lp->pmdev;
p->data = (struct net_device *)dev;
}
#endif
return el3_common_init (dev); return el3_common_init (dev);
} }
...@@ -667,6 +677,7 @@ static int __init el3_eisa_probe (struct device *device) ...@@ -667,6 +677,7 @@ static int __init el3_eisa_probe (struct device *device)
} }
#endif #endif
#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
/* This remove works for all device types. /* This remove works for all device types.
* *
* The net dev must be stored in the driver_data field */ * The net dev must be stored in the driver_data field */
...@@ -679,6 +690,7 @@ static int __devexit el3_device_remove (struct device *device) ...@@ -679,6 +690,7 @@ static int __devexit el3_device_remove (struct device *device)
el3_common_remove (dev); el3_common_remove (dev);
return 0; return 0;
} }
#endif
/* Read a word from the EEPROM using the regular EEPROM access register. /* Read a word from the EEPROM using the regular EEPROM access register.
Assume that we are in register window zero. Assume that we are in register window zero.
......
...@@ -224,9 +224,6 @@ static struct devprobe isa_probes[] __initdata = { ...@@ -224,9 +224,6 @@ static struct devprobe isa_probes[] __initdata = {
#ifdef CONFIG_EL2 /* 3c503 */ #ifdef CONFIG_EL2 /* 3c503 */
{el2_probe, 0}, {el2_probe, 0},
#endif #endif
#ifdef CONFIG_EL3
{el3_probe, 0},
#endif
#ifdef CONFIG_HPLAN #ifdef CONFIG_HPLAN
{hp_probe, 0}, {hp_probe, 0},
#endif #endif
......
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