linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: bdc: Fix return value of bdc_probe()
@ 2020-05-22  8:17 Tiezhu Yang
  2020-05-22  9:10 ` Sergei Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2020-05-22  8:17 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: linux-usb, linux-kernel, Xuefeng Li, Tiezhu Yang

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: bdc: Fix return value of bdc_probe()
  2020-05-22  8:17 [PATCH] usb: bdc: Fix return value of bdc_probe() Tiezhu Yang
@ 2020-05-22  9:10 ` Sergei Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2020-05-22  9:10 UTC (permalink / raw)
  To: Tiezhu Yang, Felipe Balbi; +Cc: linux-usb, linux-kernel, Xuefeng Li

Hello!

On 22.05.2020 11:17, Tiezhu Yang wrote:

> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
> to check the return value

    Already done.

> and return PTR_ERR() if failed.

   Yes, else the deferred probing doesn't work.

> Fixes: 893a66d34298 ("usb: bdc: use devm_platform_ioremap_resource() to simplify code")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-22  9:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  8:17 [PATCH] usb: bdc: Fix return value of bdc_probe() Tiezhu Yang
2020-05-22  9:10 ` Sergei Shtylyov

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).