[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1507511923.17567.28.camel@mhfsdcap03>
Date: Mon, 9 Oct 2017 09:18:43 +0800
From: Chunfeng Yun <chunfeng.yun@...iatek.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
CC: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
Rob Herring <robh+dt@...nel.org>,
"Mathias Nyman" <mathias.nyman@...el.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-usb@...r.kernel.org>, <linux-mediatek@...ts.infradead.org>,
<devicetree@...r.kernel.org>
Subject: Re: [PATCH 01/12] usb: mtu3: fix error return code in
ssusb_gadget_init()
On Sat, 2017-09-30 at 16:00 +0300, Sergei Shtylyov wrote:
> Hello!
>
> On 9/28/2017 3:17 AM, Chunfeng Yun wrote:
>
> > When fail to get irq number, platform_get_irq() may return
>
> Failing. IRQ. :-)
I'll modify it, thank you
>
> > -EPROBE_DEFER, but we ignore it and always return -ENODEV,
> > so fix it.
> >
> > Signed-off-by: Chunfeng Yun <chunfeng.yun@...iatek.com>
> > ---
> > drivers/usb/mtu3/mtu3_core.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
> > index 99c65b0..9475798 100644
> > --- a/drivers/usb/mtu3/mtu3_core.c
> > +++ b/drivers/usb/mtu3/mtu3_core.c
> > @@ -774,9 +774,9 @@ int ssusb_gadget_init(struct ssusb_mtk *ssusb)
> > return -ENOMEM;
> >
> > mtu->irq = platform_get_irq(pdev, 0);
> > - if (mtu->irq <= 0) {
> > + if (mtu->irq < 0) {
>
> This is good as the function no longer returns 0 on error. Even when it
> did, 0 could mean a valid IRQ as well...
>
> > dev_err(dev, "fail to get irq number\n");
> > - return -ENODEV;
> > + return mtu->irq;
> > }
> > dev_info(dev, "irq %d\n", mtu->irq);
> >
>
> MBR, Sergei
Powered by blists - more mailing lists