netdev
[Top] [All Lists]

[PATCH] hp100 -- isa probe fix

To: Jeff Garzik <jgarzik@xxxxxxxxx>
Subject: [PATCH] hp100 -- isa probe fix
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Thu, 26 Feb 2004 10:33:47 -0800
Cc: Cacophonix <cacophonix@xxxxxxxxx>, netdev@xxxxxxxxxxx
In-reply-to: <20040225213347.5491.qmail@web14006.mail.yahoo.com>
Organization: Open Source Development Lab
References: <20040224170700.11adc3cc@dell_ss3.pdx.osdl.net> <20040225213347.5491.qmail@web14006.mail.yahoo.com>
Sender: netdev-bounce@xxxxxxxxxxx
Jeff, here is a cleaned up version of the 2.6.3 hp100 isa (non-modular) probing.
It needs to check for the board being present before reading the signature.

--- linux-2.6/drivers/net/hp100.c       2004-02-24 17:08:00.000000000 -0800
+++ test-2.6/drivers/net/hp100.c        2004-02-26 10:32:33.625878016 -0800
@@ -326,16 +326,21 @@ static __init const char *hp100_read_id(
        return str;
 }
 
-static __init int hp100_isa_probe1(struct net_device *dev, int addr)
+static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
 {
        const char *sig;
        int i;
 
-       if (!request_region(addr, HP100_REGION_SIZE, "hp100"))
+       if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100"))
                goto err;
 
-       sig = hp100_read_id(addr);
-       release_region(addr, HP100_REGION_SIZE);
+       if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE) {
+               release_region(ioaddr, HP100_REGION_SIZE);
+               goto err;
+       }
+
+       sig = hp100_read_id(ioaddr);
+       release_region(ioaddr, HP100_REGION_SIZE);
 
        if (sig == NULL)
                goto err;
@@ -347,7 +352,7 @@ static __init int hp100_isa_probe1(struc
        }
 
        if (i < ARRAY_SIZE(hp100_isa_tbl))
-               return hp100_probe1(dev, addr, HP100_BUS_ISA, NULL);
+               return hp100_probe1(dev, ioaddr, HP100_BUS_ISA, NULL);
  err:
        return -ENODEV;
 

<Prev in Thread] Current Thread [Next in Thread>