summaryrefslogtreecommitdiff
path: root/drivers/usb/mtu3
diff options
context:
space:
mode:
authorChunfeng Yun <chunfeng.yun@mediatek.com>2017-10-13 17:10:37 +0800
committerFelipe Balbi <felipe.balbi@linux.intel.com>2017-10-19 10:38:10 +0300
commitc162ff0aaaac456ef29aebd1e9d4d3e305cd3279 (patch)
tree570bdd3edb305ce2fbdac4bd00c25f045ad3ad44 /drivers/usb/mtu3
parent86763723eee87bfe561cdabae2dd1c2e97933bd8 (diff)
downloadlwn-c162ff0aaaac456ef29aebd1e9d4d3e305cd3279.tar.gz
lwn-c162ff0aaaac456ef29aebd1e9d4d3e305cd3279.zip
usb: mtu3: fix error return code in ssusb_gadget_init()
When failing to get IRQ number, platform_get_irq() may return -EPROBE_DEFER, but we ignore it and always return -ENODEV, so fix it. Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/mtu3')
-rw-r--r--drivers/usb/mtu3/mtu3_core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/mtu3/mtu3_core.c b/drivers/usb/mtu3/mtu3_core.c
index 99c65b0788ff..947579842ad7 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) {
dev_err(dev, "fail to get irq number\n");
- return -ENODEV;
+ return mtu->irq;
}
dev_info(dev, "irq %d\n", mtu->irq);