RE: [PATCH 1/4] MFD: Palmas: Add Interrupt feature

From: J, KEERTHY
Date: Tue Jun 18 2013 - 05:02:02 EST


Hi Mark,


> -----Original Message-----
> From: Mark Brown [mailto:broonie@xxxxxxxxxx]
> Sent: Tuesday, June 18, 2013 2:28 PM
> To: J, KEERTHY
> Cc: linux-omap@xxxxxxxxxxxxxxx; ldewangan@xxxxxxxxxx;
> sameo@xxxxxxxxxxxxxxx; grant.likely@xxxxxxxxxxxx; swarren@xxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx; linux-doc@xxxxxxxxxxxxxxx;
> gg@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH 1/4] MFD: Palmas: Add Interrupt feature
>
> On Tue, Jun 18, 2013 at 05:15:03AM +0000, J, KEERTHY wrote:
>
> > I understand your point. The IRQ is passed from device tree node.
> > Say if the chip for some reason is not connected to any valid IRQ
> line
> > the driver might end up requesting for a wrong IRQ line.
>
> > So should I be validating the irq entry populated from device tree?
>
> Yes, you should be checking that there's actually an interrupt there -
> the number will be zero if there isn't.
>
> > Explicitly checking on chip ID helps to avoid wrongly populated
> Device
> > tree data.
>
> Right, but on the other hand it ought to be possible to handle chips
> that could but aren't configured to do interrupts and if the driver can
> do that then this becomes redundant.

I understood. I am now implementing this in the driver making use
Of the of_parse_phandle and check if the interrupts property is
Populated and only then request for irq else skip that. Hope this
Approach is fine. I will send v2 in a while.

Regards,
Keerthy
--
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/