Re: [PATCH] spi_imx.c: correct the test on platform_get_irq() return value
From: Richard Genoud
Date: Fri Jan 07 2011 - 11:42:16 EST
2011/1/7 Grant Likely <grant.likely@xxxxxxxxxxxx>:
> On Fri, Jan 7, 2011 at 7:26 AM, Richard Genoud <richard.genoud@xxxxxxxxx> wrote:
>> The test "if (spi_imx->irq <= 0)" is not testing the IRQ value, but the return value of platform_get_irq().
>> As platform_get_irq() can return an error (-ENXIO) or the IRQ value it found, the test should be "if (spi_imx->irq < 0)"
>>
>> Signed-off-by: Richard Genoud <richard.genoud@xxxxxxxxx>
>
> For the majority of architectures in Linux, 0 is not a valid IRQ for
> devices. ÂUnless there is an actual imx platform that currently
> assigns linux irq 0 to the spi controller then I'd rather not apply
> this change.
actually, there is the imx25 platform:
in arch/arm/plat-mxc/include/mach/mx25.h
line 61 :
#define MX25_INT_CSPI3 0
this is the interrupt assigned for CSPI3.
I doubled check with the imx25 release manual chapter 3.1 (page 51):
http://cache.freescale.com/files/dsp/doc/ref_manual/IMX25RM.pdf
And I made some spi test on the imx25 3stack PDK, the CSPI3 is working
with irq 0.
richard.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/