From: Thomas Gleixner <tglx@linutronix•de>
To: Bjorn Helgaas <helgaas@kernel•org>,
Marc Gonzalez <marc.w.gonzalez@free•fr>
Cc: Ryder Lee <ryder.lee@mediatek•com>,
Karthikeyan Mitran <m.karthikeyan@mobiveil•co.in>,
linux-pci@vger•kernel.org,
Linus Walleij <linus.walleij@linaro•org>,
Aman Sharma <amanharitsh123@gmail•com>,
linux-kernel@vger•kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@arm•com>,
linux-mediatek@lists•infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin•com>,
Marc Zyngier <maz@kernel•org>,
Matthias Brugger <matthias.bgg@gmail•com>,
Mans Rullgard <mans@mansr•com>,
Hou Zhiqiang <Zhiqiang.Hou@nxp•com>,
linux-arm-kernel@lists•infradead.org,
Andrew Murray <amurray@thegoodpenguin•co.uk>
Subject: Re: [PATCH 4/5] pci: handled return value of platform_get_irq correctly
Date: Fri, 13 Mar 2020 22:05:58 +0100 [thread overview]
Message-ID: <871rpwhsnd.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20200312141102.GA93224@google.com>
Bjorn,
Bjorn Helgaas <helgaas@kernel•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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-03-13 21:06 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 19:19 [PATCH 0/5] Handled return value of platform_get_irq correctly Aman Sharma
2020-03-11 19:19 ` [PATCH 1/5] pci: handled " Aman Sharma
2020-03-12 14:07 ` Linus Walleij
2020-03-12 19:02 ` Bjorn Helgaas
2020-03-12 22:45 ` Linus Walleij
2020-03-11 19:19 ` [PATCH 2/5] pci: added check for return value of platform_get_irq Aman Sharma
2020-03-11 19:19 ` [PATCH 3/5] pci: handled return value of platform_get_irq correctly Aman Sharma
2020-03-11 19:19 ` [PATCH 4/5] " Aman Sharma
2020-03-12 9:53 ` Marc Gonzalez
2020-03-12 14:11 ` Bjorn Helgaas
2020-03-12 15:53 ` Marc Gonzalez
2020-03-13 21:05 ` Thomas Gleixner [this message]
2020-03-13 21:56 ` Bjorn Helgaas
2020-03-17 22:03 ` Bjorn Helgaas
2020-03-18 13:42 ` Thomas Gleixner
2020-03-18 22:22 ` Bjorn Helgaas
2020-03-19 8:47 ` Thomas Gleixner
2020-03-19 21:35 ` Bjorn Helgaas
2020-03-11 19:19 ` [PATCH 5/5] pci: added check for return value of platform_get_irq Aman Sharma
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871rpwhsnd.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix$(echo .)de \
--cc=Zhiqiang.Hou@nxp$(echo .)com \
--cc=amanharitsh123@gmail$(echo .)com \
--cc=amurray@thegoodpenguin$(echo .)co.uk \
--cc=helgaas@kernel$(echo .)org \
--cc=linus.walleij@linaro$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mediatek@lists$(echo .)infradead.org \
--cc=linux-pci@vger$(echo .)kernel.org \
--cc=lorenzo.pieralisi@arm$(echo .)com \
--cc=m.karthikeyan@mobiveil$(echo .)co.in \
--cc=mans@mansr$(echo .)com \
--cc=marc.w.gonzalez@free$(echo .)fr \
--cc=matthias.bgg@gmail$(echo .)com \
--cc=maz@kernel$(echo .)org \
--cc=ryder.lee@mediatek$(echo .)com \
--cc=thomas.petazzoni@bootlin$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox