[PATCH] Slight refactor of interrupt mapping for FSL parts
Kumar Gala
galak at kernel.crashing.org
Tue Oct 17 07:54:29 EST 2006
On Oct 16, 2006, at 4:37 PM, Kumar Gala wrote:
>
> On Oct 16, 2006, at 3:57 PM, Andy Fleming wrote:
>
>>
>> * Cleaned up interrupt mapping a little by adding a helper
>> function which parses the irq out of the device-tree, and puts
>> it into a resource.
>> * Changed the PHY Layer to use NO_IRQ instead of -1 for PHY_POLL.
>> This means that polling will always be used if mapping the
>> interrupt fails for any reason.
>
> You forgot to fixup the arch/ppc users of this.
>
>
>> ---
>> arch/powerpc/sysdev/fsl_soc.c | 33 +++++++++++++++
>> +-----------------
>> include/linux/phy.h | 2 +-
>> 2 files changed, 17 insertions(+), 18 deletions(-)
>>
>> diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/
>> fsl_soc.c
>> index dbe92ae..aa24b51 100644
>> --- a/arch/powerpc/sysdev/fsl_soc.c
>> +++ b/arch/powerpc/sysdev/fsl_soc.c
>> @@ -146,7 +146,7 @@ static int __init gfar_mdio_of_init(void
>> }
>>
>> for (k = 0; k < 32; k++)
>> - mdio_data.irq[k] = -1;
>> + mdio_data.irq[k] = NO_IRQ;
>>
>> while ((child = of_get_next_child(np, child)) != NULL) {
>> int irq = irq_of_parse_and_map(child, 0);
>> @@ -177,6 +177,13 @@ static const char *gfar_tx_intr = "tx";
>> static const char *gfar_rx_intr = "rx";
>> static const char *gfar_err_intr = "error";
>>
>> +
>> +void of_irq_to_resource(struct device_node *dev, int index, struct
>> resource *r)
>> +{
>> + r->start = r->end = irq_of_parse_and_map(dev, index);
>> + r->flags = IORESOURCE_IRQ;
>> +}
>
> Why don't you stick this in prom_parse.c (and add a prototype to
> prom.h)
Actually, just implement it in the header.
- k
More information about the Linuxppc-dev
mailing list