Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742629

Re: [PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init()

From Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Newsgroups linux.kernel
Subject Re: [PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init()
Date 2017-09-30 15:10 +0200
Message-ID <uvpGN-4yj-5@gated-at.bofh.it> (permalink)
References <uuiel-1ki-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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@mediatek.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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 01/12] usb: mtu3: fix error return code in ssusb_gadget_init() Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:00 +0200
  [PATCH 09/12] usb: mtu3: set invalid dr_mode as dual-role mode Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:00 +0200
  [PATCH 06/12] usb: mtu3: use FORCE/RG_IDDIG to implement manual DRD switch Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:00 +0200
  [PATCH 03/12] usb: mtu3: remove dummy wakeup debounce clocks Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:10 +0200
  [PATCH 02/12] usb: mtu3: support option to disable usb3 ports Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:10 +0200
  [PATCH 04/12] usb: mtu3: add optional mcu and dma bus clocks Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:10 +0200
  [PATCH 05/12] usb: mtu3: support 36-bit DMA address Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-27 13:10 +0200
  [PATCH 11/12] dt-bindings: usb: mtu3: remove dummy clocks and add optional ones Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-28 02:20 +0200
  [PATCH 12/12] dt-bindings: usb: mtu3: remove optional pinctrls Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-28 02:20 +0200
  [PATCH 10/12] dt-bindings: usb: mtu3: add a optional property to disable u3ports Chunfeng Yun <chunfeng.yun@mediatek.com> - 2017-09-28 02:20 +0200
  Re: [PATCH 01/12] usb: mtu3: fix error return code in  ssusb_gadget_init() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2017-09-30 15:10 +0200

csiph-web