linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Aman Sharma <amanharitsh123@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Andrew Murray <amurray@thegoodpenguin.co.uk>,
	Ryder Lee <ryder.lee@mediatek.com>,
	Karthikeyan Mitran <m.karthikeyan@mobiveil.co.in>,
	Hou Zhiqiang <Zhiqiang.Hou@nxp.com>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	Mans Rullgard <mans@mansr.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-pci <linux-pci@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 1/5] pci: handled return value of platform_get_irq correctly
Date: Thu, 12 Mar 2020 23:45:21 +0100	[thread overview]
Message-ID: <CACRpkdZrSHTry1fmFbrAAwbVu_zi1oez-uD5-8RtOVL_H54O+w@mail.gmail.com> (raw)
In-Reply-To: <20200312190202.GA110276@google.com>

On Thu, Mar 12, 2020 at 8:02 PM Bjorn Helgaas <helgaas@kernel.org> wrote:

> IIUC, in the link you mentioned, Linus T says that "dev->irq == 0"
> means we don't have a valid IRQ.  I think that makes sense, but I'm
> not sure it follows that 0 must be a sensical return value for
> platform_get_irq().  It seems to me that platform_get_irq() ought to
> return either a valid IRQ or an error, and the convention for errors
> is a negative errno.

OK I see your point.

I would be fine of the code is changed from:

if (irq <= 0)
  error;

To:

if (irq < 0)
   error retrieving IRQ

if (!irq)
   error driver requires a valid IRQ

To the driver (this one in specific) the IRQ is expected and
necessary and I think it holds for most PCI hosts.

Yours,
Linus Walleij

  reply	other threads:[~2020-03-12 22:45 UTC|newest]

Thread overview: 21+ 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-11 20:57   ` Bjorn Helgaas
2020-04-06 21:28     ` Bjorn Helgaas
2020-03-12 14:07   ` Linus Walleij
2020-03-12 19:02     ` Bjorn Helgaas
2020-03-12 22:45       ` Linus Walleij [this message]
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
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=CACRpkdZrSHTry1fmFbrAAwbVu_zi1oez-uD5-8RtOVL_H54O+w@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=Zhiqiang.Hou@nxp.com \
    --cc=amanharitsh123@gmail.com \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=helgaas@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=m.karthikeyan@mobiveil.co.in \
    --cc=mans@mansr.com \
    --cc=marc.w.gonzalez@free.fr \
    --cc=matthias.bgg@gmail.com \
    --cc=maz@kernel.org \
    --cc=ryder.lee@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).