[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <871rpwhsnd.fsf@nanos.tec.linutronix.de>
Date: Fri, 13 Mar 2020 22:05:58 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Bjorn Helgaas <helgaas@...nel.org>,
Marc Gonzalez <marc.w.gonzalez@...e.fr>
Cc: Aman Sharma <amanharitsh123@...il.com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
Andrew Murray <amurray@...goodpenguin.co.uk>,
Linus Walleij <linus.walleij@...aro.org>,
Ryder Lee <ryder.lee@...iatek.com>,
Karthikeyan Mitran <m.karthikeyan@...iveil.co.in>,
Hou Zhiqiang <Zhiqiang.Hou@....com>,
Mans Rullgard <mans@...sr.com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-pci@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
Marc Zyngier <maz@...nel.org>
Subject: Re: [PATCH 4/5] pci: handled return value of platform_get_irq correctly
Bjorn,
Bjorn Helgaas <helgaas@...nel.org> writes:
> On Thu, Mar 12, 2020 at 10:53:06AM +0100, Marc Gonzalez wrote:
>> Last time around, my understanding was that, going forward,
>> the best solution was:
>>
>> virq = platform_get_irq(...)
>> if (virq <= 0)
>> return virq ? : -ENODEV;
>>
>> i.e. map 0 to -ENODEV, pass other errors as-is, remove the dev_err
>>
>> @Bjorn/Lorenzo did you have a change of heart?
>
> Yes. In 10006651 (Oct 20, 2017), I thought:
>
> irq = platform_get_irq(pdev, 0);
> if (irq <= 0)
> return -ENODEV;
>
> was fine. In 11066455 (Aug 7, 2019), I said I thought I was wrong and
> that:
>
> platform_get_irq() is a generic interface and we have to be able to
> interpret return values consistently. The overwhelming consensus
> among platform_get_irq() callers is to treat "irq < 0" as an error,
> and I think we should follow suit.
> ...
> I think the best pattern is:
>
> irq = platform_get_irq(pdev, i);
> if (irq < 0)
> return irq;
Careful. 0 is not a valid interrupt.
Thanks,
tglx
Powered by blists - more mailing lists