cs89x0_platform : avoid requesting the i/o memory range twice
Subsystems (2)
PATCH 2/2 cs89x0_platform : avoid requesting the i/o memory range twice
When the platform driver option of the cs89x0 driver is used, the i/o memory range is requested twice, resulting in a failed driver initialization.
Signed-off-by Jaccon Bastiaansen <[email protected]>
--- drivers/net/ethernet/cirrus/cs89x0.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/cirrus/cs89x0.c +8 -8
@@ -544,14 +544,15 @@ cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular) } +#ifndef CONFIG_CS89x0_PLATFORM/* Grab the region so we can find another board if autoIRQ fails. */ /* WTF is going on here? */ if (!request_region (ioaddr & ~3 ,NETCARD_IO_EXTENT ,DRV_NAME )) {printk (KERN_ERR "%s: request_region(0x%lx, 0x%x) failed\n" ,DRV_NAME , ioaddr,NETCARD_IO_EXTENT ); - retval = -EBUSY ; - goto out1; +return -EBUSY ; } +#endif /* if they give us an odd I/O address, then do ONE write to the address port, to get it back to address zero, where we
@@ -565,7 +566,7 @@ cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular)printk (KERN_ERR "%s: bad signature 0x%x\n" , dev->name,readword (ioaddr & ~3 ,ADD_PORT )); retval = -ENODEV ; - goto out2; + goto out1; } }
@@ -580,7 +581,7 @@ cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular)CHIP_EISA_ID_SIG_STR "\n" , dev->name, ioaddr, DATA_PORT, tmp); retval = -ENODEV ; - goto out2; + goto out1; }/* Fill in the 'dev' fields. */
@@ -799,13 +800,12 @@ cs89x0_probe1(struct net_device *dev, unsigned long ioaddr, int modular) retval =register_netdev (dev);if (retval) - goto out3; + goto out2;return 0 ; -out3: -writeword (dev->base_addr,ADD_PORT , PP_ChipID); out2: -release_region (ioaddr & ~3 ,NETCARD_IO_EXTENT ); +writeword (dev->base_addr,ADD_PORT , PP_ChipID); out1: +release_region (ioaddr & ~3 ,NETCARD_IO_EXTENT );return retval; }
Signature · 1 line
1.7.1