[PATCH 2/6] arm/imx: remove the uses of gpio_to_irq()

Russell King - ARM Linux linux at arm.linux.org.uk
Fri Aug 12 04:57:59 EDT 2011


On Fri, Aug 12, 2011 at 04:25:39PM +0800, Shawn Guo wrote:
> On Fri, Aug 12, 2011 at 04:22:12PM +0800, Shawn Guo wrote:
> > On Fri, Aug 12, 2011 at 09:00:00AM +0100, Russell King - ARM Linux wrote:
> > > On Fri, Aug 12, 2011 at 03:54:57PM +0800, Shawn Guo wrote:
> > > > gpio_to_irq() is too generic to be defined and used by i.mx platform
> > > > code.  The patch defines IMX_GPIO_TO_IRQ() in mach/hardware.h and
> > > > replaces all the uses of gpio_to_irq() with IMX_GPIO_TO_IRQ().
> > > 
> > > That makes no sense.  Why not continue to use gpio_to_irq() but provide
> > > the .to_irq method in your gpiolib driver so it can work, and use that
> > > in the places where its used at runtime?
> > > 
> > I did provide .to_irq in patch #3. 
> > 
> > > (You won't be able to use it for static initialization obviously.)
> > > 
> > All users of gpio_to_irq() in platform codes are static initialization.
> 
> Sorry, not all but most.

It would probably be a good idea to leave the runtime places using
gpio_to_irq() and only convert the static initializers.

> > And IMX_GPIO_TO_IRQ() is actually a renaming of gpio_to_irq().  Only
> > difference there is naming and place change, which I think is good, no?
> > 
> 
> But adding IMX namespace is still worth of the LOC changes?

Well, the static initializers still need something... the alternative is
to initialize them at runtime which probably wouldn't be so nice.



More information about the linux-arm-kernel mailing list