lkml.org 
[lkml]   [2011]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] ata: Don't use NO_IRQ in pata_of_platform driver
[expanding CC -- apologies to anyone who gets this mail twice]

On Thu, Nov 10, 2011 at 08:28:59PM +0400, Anton Vorontsov wrote:
> Drivers should not use NO_IRQ; moreover, some architectures don't
> have it nowadays. '0' is the 'no irq' case.
>
> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
> Acked-by: Alan Cox <alan@linux.intel.com>
> ---
>
> On Thu, Nov 10, 2011 at 03:38:16PM +0000, Alan Cox wrote:
> > On Thu, 10 Nov 2011 19:26:06 +0400
> > Anton Vorontsov <cbouatmailru@gmail.com> wrote:
> >
> > > Drivers should not use NO_IRQ; moreover, some architectures don't
> > > have it nowadays. '0' is the 'no irq' case.
> > >
> > > Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
> >
> > Acked-by: Alan Cox <alan@linux.intel.com>
>
> In case if we don't want a "band-aid fix" for 3.2, here is the patch
> that just does the proper fix (w/ a risk to break minor architectures).

This is now broken on ARM where, for good or bad, NO_IRQ currently is
used and is -1.

How do we resolve it? If we are ready to eliminate NO_IRQ from
drivers/of/irq.c (or indeed, all code that uses it) and just use 0 for
that case, we should surely just do it... but I'm not confident I can
judge on that.

Half-removing NO_IRQ is going to be problematic, though...
I really don't care whether the "no irq" value is 0 or -1, but it is
abundantly clear that choosing different values to mean the same thing
on opposite sides of an interface does not work.

Cheers
---Dave

>
> drivers/ata/pata_of_platform.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/ata/pata_of_platform.c b/drivers/ata/pata_of_platform.c
> index a72ab0d..2a472c5 100644
> --- a/drivers/ata/pata_of_platform.c
> +++ b/drivers/ata/pata_of_platform.c
> @@ -52,7 +52,7 @@ static int __devinit pata_of_platform_probe(struct platform_device *ofdev)
> }
>
> ret = of_irq_to_resource(dn, 0, &irq_res);
> - if (ret == NO_IRQ)
> + if (!ret)
> irq_res.start = irq_res.end = 0;
> else
> irq_res.flags = 0;
> --
> 1.7.5.3
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss


\
 
 \ /
  Last update: 2011-12-02 20:29    [W:0.103 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site