[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1590135456-11176-1-git-send-email-yangtiezhu@loongson.cn>
Date: Fri, 22 May 2020 16:17:36 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Felipe Balbi <balbi@...nel.org>
Cc: linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
Xuefeng Li <lixuefeng@...ngson.cn>,
Tiezhu Yang <yangtiezhu@...ngson.cn>
Subject: [PATCH] usb: bdc: Fix return value of bdc_probe()
When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.
Fixes: 893a66d34298 ("usb: bdc: use devm_platform_ioremap_resource() to simplify code")
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
drivers/usb/gadget/udc/bdc/bdc_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c
index 02a3a77..c48fdd3 100644
--- a/drivers/usb/gadget/udc/bdc/bdc_core.c
+++ b/drivers/usb/gadget/udc/bdc/bdc_core.c
@@ -510,7 +510,7 @@ static int bdc_probe(struct platform_device *pdev)
bdc->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(bdc->regs)) {
dev_err(dev, "ioremap error\n");
- return -ENOMEM;
+ return PTR_ERR(bdc->regs);
}
irq = platform_get_irq(pdev, 0);
if (irq < 0)
--
2.1.0
Powered by blists - more mailing lists