devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov-M4DtvfQ/ZS1MRgGoP+s0PdBPR1lH4CV8@public.gmane.org>
To: Chunfeng Yun
	<chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	Felipe Balbi
	<felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Mathias Nyman
	<mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init()
Date: Sat, 30 Sep 2017 16:00:28 +0300	[thread overview]
Message-ID: <46f6e8f0-0398-e33e-10fc-d0db6ce06db0@cogentembedded.com> (raw)
In-Reply-To: <fe8df8503f602586bcea4b1598eb09678b1525e3.1506509658.git.chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>

Hello!

On 9/28/2017 3:17 AM, Chunfeng Yun wrote:

> When fail to get irq number, platform_get_irq() may return

    Failing. IRQ. :-)

> -EPROBE_DEFER, but we ignore it and always return -ENODEV,
> so fix it.
> 
> Signed-off-by: Chunfeng Yun <chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>   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
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-09-30 13:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-27 10:58 [PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init() Chunfeng Yun
2017-09-27 10:58 ` [PATCH 02/12] usb: mtu3: support option to disable usb3 ports Chunfeng Yun
2017-09-27 10:58 ` [PATCH 04/12] usb: mtu3: add optional mcu and dma bus clocks Chunfeng Yun
2017-09-27 10:58 ` [PATCH 05/12] usb: mtu3: support 36-bit DMA address Chunfeng Yun
2017-09-27 10:58 ` [PATCH 06/12] usb: mtu3: use FORCE/RG_IDDIG to implement manual DRD switch Chunfeng Yun
     [not found] ` <fe8df8503f602586bcea4b1598eb09678b1525e3.1506509658.git.chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-09-27 10:58   ` [PATCH 03/12] usb: mtu3: remove dummy wakeup debounce clocks Chunfeng Yun
2017-09-27 10:58   ` [PATCH 07/12] usb: mtu3: add support for usb3.1 IP Chunfeng Yun
2017-09-29 14:11     ` Chunfeng Yun
2017-09-30 13:00   ` Sergei Shtylyov [this message]
2017-10-09  1:18     ` [PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init() Chunfeng Yun
2017-09-27 10:58 ` [PATCH 08/12] usb: mtu3: get optional vbus for host only mode Chunfeng Yun
2017-09-27 10:58 ` [PATCH 09/12] usb: mtu3: set invalid dr_mode as dual-role mode Chunfeng Yun
2017-09-28  0:17 ` [PATCH 10/12] dt-bindings: usb: mtu3: add a optional property to disable u3ports Chunfeng Yun
2017-10-05 22:31   ` Rob Herring
2017-10-09  2:43     ` Chunfeng Yun
2017-09-28  0:17 ` [PATCH 11/12] dt-bindings: usb: mtu3: remove dummy clocks and add optional ones Chunfeng Yun
2017-09-28  0:17 ` [PATCH 12/12] dt-bindings: usb: mtu3: remove optional pinctrls Chunfeng Yun
     [not found]   ` <ec8e65205c6e0a83850e11c030ed440d7b9be2e8.1506509659.git.chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2017-10-05 22:33     ` Rob Herring
2017-10-09  3:25       ` Chunfeng Yun

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=46f6e8f0-0398-e33e-10fc-d0db6ce06db0@cogentembedded.com \
    --to=sergei.shtylyov-m4dtvfq/zs1mrggop+s0pdbpr1lh4cv8@public.gmane.org \
    --cc=chunfeng.yun-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=felipe.balbi-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mathias.nyman-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /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).