All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix smc911x compilation breakage
@ 2007-04-27 10:35 Vitaly Wool
  2007-04-28 15:33 ` Jeff Garzik
  0 siblings, 1 reply; 5+ messages in thread
From: Vitaly Wool @ 2007-04-27 10:35 UTC (permalink / raw)
  To: jgarzik; +Cc: dustin, netdev

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(-)

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>

Index: linux-2.6/drivers/net/smc911x.c
===================================================================
--- linux-2.6.orig/drivers/net/smc911x.c
+++ 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"
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix smc911x compilation breakage
  2007-04-27 10:35 [PATCH] fix smc911x compilation breakage Vitaly Wool
@ 2007-04-28 15:33 ` Jeff Garzik
  2007-04-28 18:10   ` Vitaly Wool
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Garzik @ 2007-04-28 15:33 UTC (permalink / raw)
  To: Vitaly Wool; +Cc: dustin, netdev, Russell King, Andrew Morton

Vitaly Wool wrote:
> 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(-)
> 
> Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
> 
> Index: linux-2.6/drivers/net/smc911x.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/smc911x.c
> +++ 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"

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

	Jeff



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix smc911x compilation breakage
  2007-04-28 15:33 ` Jeff Garzik
@ 2007-04-28 18:10   ` Vitaly Wool
  2007-04-29  8:05     ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Vitaly Wool @ 2007-04-28 18:10 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: dustin, netdev, Russell King, Andrew Morton

Hello Jeff,

> Vitaly Wool wrote:
> > Index: linux-2.6/drivers/net/smc911x.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/net/smc911x.c
> > +++ 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"
> 
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] fix smc911x compilation breakage
  2007-04-28 18:10   ` Vitaly Wool
@ 2007-04-29  8:05     ` Russell King
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2007-04-29  8:05 UTC (permalink / raw)
  To: Vitaly Wool; +Cc: Jeff Garzik, dustin, netdev, Andrew Morton

On Sat, Apr 28, 2007 at 10:10:57PM +0400, Vitaly Wool wrote:
> Hello Jeff,
> 
> > Vitaly Wool wrote:
> > > Index: linux-2.6/drivers/net/smc911x.c
> > > ===================================================================
> > > --- linux-2.6.orig/drivers/net/smc911x.c
> > > +++ 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"
> > 
> > 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.

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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [patch] fix smc911x compilation breakage
@ 2007-04-30 16:57 Vitaly Wool
  0 siblings, 0 replies; 5+ messages in thread
From: Vitaly Wool @ 2007-04-30 16:57 UTC (permalink / raw)
  To: jgarzik, rmk; +Cc: netdev

Hello,

this is the updated version of smc911x compilation breakage fix.
Hope it's fine now. It just adapts the driver to the new IRQ API
according to what Russell has pointed out.

 drivers/net/smc911x.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index c956141..4b9bdad 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -77,7 +77,6 @@ static const char version[] =
 #include <linux/skbuff.h>
 
 #include <asm/io.h>
-#include <asm/irq.h>
 
 #include "smc911x.h"
 
@@ -2086,12 +2085,11 @@ static int __init smc911x_probe(struct n
 	lp->ctl_rspeed = 100;
 
 	/* Grab the IRQ */
-	retval = request_irq(dev->irq, &smc911x_interrupt, IRQF_SHARED, dev->name, dev);
+	retval = request_irq(dev->irq, &smc911x_interrupt,
+			IRQF_SHARED | IRQF_TRIGGER_FALLING, dev->name, dev);
 	if (retval)
 		goto err_out;
 
-	set_irq_type(dev->irq, IRQT_FALLING);
-
 #ifdef SMC_USE_DMA
 	lp->rxdma = SMC_DMA_REQUEST(dev, smc911x_rx_dma_irq);
 	lp->txdma = SMC_DMA_REQUEST(dev, smc911x_tx_dma_irq);




^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-30 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-27 10:35 [PATCH] fix smc911x compilation breakage Vitaly Wool
2007-04-28 15:33 ` Jeff Garzik
2007-04-28 18:10   ` Vitaly Wool
2007-04-29  8:05     ` Russell King
2007-04-30 16:57 [patch] " Vitaly Wool

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.