Skip to contentSkip to conversation

fix smc911x compilation breakage

PATCH In review Vitaly Wool 3 participants 4 messages Apr 27, 2007 – Apr 29, 2007

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

PATCH 1/1 fix smc911x compilation breakage

Hi Jeff,

currently (with 2.6.21) compilation of smc911x driver fails in the following way:

CC drivers/net/smc911x.o
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c: In function `smc911x_probe':
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: warning: implicit declaration of function set_irq_type' /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: IRQ_TYPE_EDGE_FALLING' undeclared (first use in this function) /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: (Each undeclared identifier is reported only once /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: for each function it appears in.) make[3]: *** [drivers/net/smc911x.o] Error 1
make[2]: *** [drivers/net] Error 2
make[1]: *** [drivers] Error 2
make: *** [zImage] Error 2

The patch inlined below fixes the problem.

 smc911x.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
drivers/net/smc911x.c +1 -1
Index: linux-2.6/drivers/net/smc911x.c
===================================================================
@@ -75,9 +75,9 @@ static const char version[] =
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/irq.h>
 
 #include <asm/io.h>
-#include <asm/irq.h>
 
 #include "smc911x.h"
 
#1 lore raw
Quoted 27 lines · Vitaly Wool

Hi Jeff,

currently (with 2.6.21) compilation of smc911x driver fails in the following way:

CC drivers/net/smc911x.o
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c: In function `smc911x_probe':
/sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: warning: implicit declaration of function set_irq_type' /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: IRQ_TYPE_EDGE_FALLING' undeclared (first use in this function) /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: (Each undeclared identifier is reported only once /sandbox/vital/opensource/linux-2.6/drivers/net/smc911x.c:2125: error: for each function it appears in.) make[3]: *** [drivers/net/smc911x.o] Error 1
make[2]: *** [drivers/net] Error 2
make[1]: *** [drivers] Error 2
make: *** [zImage] Error 2

The patch inlined below fixes the problem.

 smc911x.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/net/smc911x.c
===================================================================

drivers/net/smc911x.c static const char version[] = · line 82

Quoted 9 lines
drivers/net/smc911x.c +1 -1
@@ -75,9 +75,9 @@ static const char version[] =
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/irq.h>
 
 #include <asm/io.h>
-#include <asm/irq.h>
 
 #include "smc911x.h"

This seems to clash with rmk's comment at the top of linux/irq.h?

Jeff

#2 lore raw

Hello Jeff,

Quoted 11 lines
Quoted 10 lines · Vitaly Wool

Index: linux-2.6/drivers/net/smc911x.c
===================================================================

drivers/net/smc911x.c +1 -0
@@ -75,9 +75,9 @@ static const char version[] =
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/irq.h>
 
Quoted 6 lines

drivers/net/smc911x.c static const char version[] = · line 82

Quoted 4 lines
drivers/net/smc911x.c +0 -1
 #include <asm/io.h>
-#include <asm/irq.h>
 
 #include "smc911x.h"

This seems to clash with rmk's comment at the top of linux/irq.h?

In a way, yes, but I just was fixing the compilation problem, and not changing the logic in any way. The driver currently calls set_irq_type so it has to include linux/irq.h, just as it had to include asm/irq.h before.

I'd guess that set_irq_type better be called by generic code and either just make the driver don't even bother or call a callback set by platform part. If you're fine with any of these, and think it's better than the initial patch, please let me know and I'll proceed with that.

Thanks,
Vitaly

#3 lore raw
Quoted 25 lines · Vitaly Wool

Hello Jeff,

Quoted 11 lines
Quoted 10 lines · Vitaly Wool

Index: linux-2.6/drivers/net/smc911x.c
===================================================================

drivers/net/smc911x.c +1 -0
@@ -75,9 +75,9 @@ static const char version[] =
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/irq.h>
 
Quoted 6 lines

drivers/net/smc911x.c static const char version[] = · line 82

Quoted 4 lines
drivers/net/smc911x.c +0 -1
 #include <asm/io.h>
-#include <asm/irq.h>
 
 #include "smc911x.h"

This seems to clash with rmk's comment at the top of linux/irq.h?

In a way, yes, but I just was fixing the compilation problem, and not changing the logic in any way. The driver currently calls set_irq_type so it has to include linux/irq.h, just as it had to include asm/irq.h before.

Quoted 4 lines

I'd guess that set_irq_type better be called by generic code and either just make the driver don't even bother or call a callback set by platform part. If you're fine with any of these, and think it's better than the initial patch, please let me know and I'll proceed with that.

Drivers should really be using IRQF_TRIGGER_* constants, not set_irq_type() unless they have a very good reason. I doubt this driver has such a reason, and it's just coded for an older version of the ARM IRQ API.

Signature · 3 lines
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of: