Skip to contentSkip to conversation

3c515: fix using pnp_get_resource when CONFIG_ISAPNP=n

PATCH Applied Randy Dunlap 3 participants 5 messages May 16, 2008 – May 22, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 3c515: fix using pnp_get_resource when CONFIG_ISAPNP=n

From: Randy Dunlap <[email protected]>

3c515.c uses pnp_irq(), which calls pnp_get_resource(), which is not defined when CONFIG_PNP=n, so in that case, get the IRQ from a hardware register.

3c515.c:(.text+0x3adc0): undefined reference to `pnp_get_resource'

---
 drivers/net/3c515.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/net/3c515.c +4 -0
@@ -572,12 +572,16 @@ static int corkscrew_setup(struct net_de
 	int irq;
 	DECLARE_MAC_BUF(mac);
 
+#ifdef __ISAPNP__
 	if (idev) {
 		irq = pnp_irq(idev, 0);
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
 	}
+#else
+	irq = inw(ioaddr + 0x2002) & 15;
+#endif
 
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

3c515.c uses pnp_irq(), which calls pnp_get_resource(), which is not defined when CONFIG_PNP=n, so in that case, get the IRQ from a hardware register.

3c515.c:(.text+0x3adc0): undefined reference to `pnp_get_resource'

Hmm, wonder why my allyesconfig didn't catch this one. I prefer CONFIG_PNP to __ISAPNP__ in general, but I see you're just following the other tests in the same file.

Thanks!

Quoted 24 lines
---
 drivers/net/3c515.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/net/3c515.c +4 -0
@@ -572,12 +572,16 @@ static int corkscrew_setup(struct net_de
 	int irq;
 	DECLARE_MAC_BUF(mac);
 
+#ifdef __ISAPNP__
 	if (idev) {
 		irq = pnp_irq(idev, 0);
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
 	}
+#else
+	irq = inw(ioaddr + 0x2002) & 15;
+#endif
 
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
#2 lore raw
Quoted 7 lines · Bjorn Helgaas
Quoted 6 lines · Randy Dunlap

From: Randy Dunlap <[email protected]>

3c515.c uses pnp_irq(), which calls pnp_get_resource(), which is not defined when CONFIG_PNP=n, so in that case, get the IRQ from a hardware register.

Quoted 5 lines
Quoted 3 lines

3c515.c:(.text+0x3adc0): undefined reference to `pnp_get_resource'

Hmm, wonder why my allyesconfig didn't catch this one.

Because parts of it are =n. :)

Quoted 2 lines

I prefer CONFIG_PNP to __ISAPNP__ in general, but I see you're just following the other tests in the same file.

Yes. And it would need to be CONFIG_ISAPNP, not CONFIG_PNP.

Quoted 31 lines

Thanks!

Quoted 24 lines
---
 drivers/net/3c515.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/net/3c515.c +4 -0
@@ -572,12 +572,16 @@ static int corkscrew_setup(struct net_de
 	int irq;
 	DECLARE_MAC_BUF(mac);
 
+#ifdef __ISAPNP__
 	if (idev) {
 		irq = pnp_irq(idev, 0);
 		vp->dev = &idev->dev;
 	} else {
 		irq = inw(ioaddr + 0x2002) & 15;
 	}
+#else
+	irq = inw(ioaddr + 0x2002) & 15;
+#endif
 
 	dev->base_addr = ioaddr;
 	dev->irq = irq;
Signature · 1 line
~Randy
#3 lore raw
Quoted 5 lines · Randy Dunlap
Quoted 2 lines · Bjorn Helgaas

I prefer CONFIG_PNP to __ISAPNP__ in general, but I see you're just following the other tests in the same file.

Yes. And it would need to be CONFIG_ISAPNP, not CONFIG_PNP.

Huh. Sure enough. I hadn't even noticed pnp_find_dev(). I'm not sure why pnp_find_dev() should be under CONFIG_ISAPNP rather than CONFIG_PNP, other than the fact that it uses ISAPNP_ANY_ID.

On the other hand, there are only 25-30 users of pnp_find_dev(); maybe I should just look at converting them and nuking the compat interfaces completely.

Bjorn