patch-2.4.20 linux-2.4.20/drivers/net/eexpress.c
Next file: linux-2.4.20/drivers/net/epic100.c
Previous file: linux-2.4.20/drivers/net/eepro100.c
Back to the patch index
Back to the overall index
- Lines: 57
- Date:
Thu Nov 28 15:53:13 2002
- Orig file:
linux-2.4.19/drivers/net/eexpress.c
- Orig date:
Mon Feb 25 11:37:59 2002
diff -urN linux-2.4.19/drivers/net/eexpress.c linux-2.4.20/drivers/net/eexpress.c
@@ -341,7 +341,7 @@
int __init express_probe(struct net_device *dev)
{
unsigned short *port;
- static unsigned short ports[] = { 0x300,0x310,0x270,0x320,0x340,0 };
+ static unsigned short ports[] = { 0x240,0x300,0x310,0x270,0x320,0x340,0 };
unsigned short ioaddr = dev->base_addr;
SET_MODULE_OWNER(dev);
@@ -436,10 +436,26 @@
ret = request_irq(dev->irq,&eexp_irq,0,dev->name,dev);
if (ret) return ret;
- request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress");
- request_region(ioaddr+0x4000, 16, "EtherExpress shadow");
- request_region(ioaddr+0x8000, 16, "EtherExpress shadow");
- request_region(ioaddr+0xc000, 16, "EtherExpress shadow");
+ if (!request_region(ioaddr, EEXP_IO_EXTENT, "EtherExpress")) {
+ printk(KERN_WARNING "EtherExpress io port %x, is busy.\n"
+ , ioaddr);
+ goto err_out1;
+ }
+ if (!request_region(ioaddr+0x4000, EEXP_IO_EXTENT, "EtherExpress shadow")) {
+ printk(KERN_WARNING "EtherExpress io port %x, is busy.\n"
+ , ioaddr+0x4000);
+ goto err_out2;
+ }
+ if (!request_region(ioaddr+0x8000, EEXP_IO_EXTENT, "EtherExpress shadow")) {
+ printk(KERN_WARNING "EtherExpress io port %x, is busy.\n"
+ , ioaddr+0x8000);
+ goto err_out3;
+ }
+ if (!request_region(ioaddr+0xc000, EEXP_IO_EXTENT, "EtherExpress shadow")) {
+ printk(KERN_WARNING "EtherExpress io port %x, is busy.\n"
+ , ioaddr+0xc000);
+ goto err_out4;
+ }
if (lp->width) {
printk("%s: forcing ASIC to 8-bit mode\n", dev->name);
@@ -452,6 +468,16 @@
printk(KERN_DEBUG "%s: leaving eexp_open()\n", dev->name);
#endif
return 0;
+
+ err_out4:
+ release_region(ioaddr+0x8000, EEXP_IO_EXTENT);
+ err_out3:
+ release_region(ioaddr+0x4000, EEXP_IO_EXTENT);
+ err_out2:
+ release_region(ioaddr, EEXP_IO_EXTENT);
+ err_out1:
+ free_irq(dev->irq, dev);
+ return -EBUSY;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)