Commit d7de5700 authored by Jeff Garzik's avatar Jeff Garzik

request_region cleanups from 2.4 and the kernel janitors.

Via Dave Jones.
parent c7999225
......@@ -241,7 +241,10 @@ static int __init com90io_found(struct net_device *dev)
return -ENODEV;
}
/* Reserve the I/O region - guaranteed to work by check_region */
request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)");
if (!request_region(dev->base_addr, ARCNET_TOTAL_SIZE, "arcnet (COM90xx-IO)")) {
free_irq(dev->irq, dev);
return -EBUSY;
}
/* Initialize the rest of the device structure. */
dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
......
......@@ -1674,7 +1674,6 @@ void cleanup_module(void)
unregister_netdev(dev);
kfree(dev->priv);
dev->priv = NULL;
release_region(dev->base_addr, EEXP_IO_EXTENT);
}
}
}
......
......@@ -204,7 +204,12 @@ sb1000_probe(struct net_device *dev)
/*
* Ok set it up.
*/
if (!request_region(ioaddr[0], 16, dev->name))
continue;
if (!request_region(ioaddr[1], 16, dev->name)) {
release_region(ioaddr[0], 16);
continue;
}
dev->base_addr = ioaddr[0];
/* rmem_end holds the second I/O address - fv */
......@@ -262,9 +267,6 @@ sb1000_probe(struct net_device *dev)
/* Lock resources */
request_region(ioaddr[0], 16, dev->name);
request_region(ioaddr[1], 16, dev->name);
return 0;
}
}
......@@ -962,8 +964,6 @@ sb1000_open(struct net_device *dev)
/* rmem_end holds the second I/O address - fv */
ioaddr[1] = dev->rmem_end;
name = dev->name;
request_region(ioaddr[0], SB1000_IO_EXTENT, "sb1000");
request_region(ioaddr[1], SB1000_IO_EXTENT, "sb1000");
/* initialize sb1000 */
if ((status = sb1000_reset(ioaddr, name)))
......
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