2020-08-26 14:53:09

by Tang Bin

[permalink] [raw]
Subject: [PATCH] usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()

If the function platform_get_irq() failed, the negative value
returned will not be detected here. So fix error handling in
exynos_ohci_probe(). And when get irq failed, the function
platform_get_irq() logs an error message, so remove redundant
message here.

Fixes: 62194244cf87 ("USB: Add Samsung Exynos OHCI diver")
Signed-off-by: Zhang Shengju <[email protected]>
Signed-off-by: Tang Bin <[email protected]>
---
drivers/usb/host/ohci-exynos.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ohci-exynos.c b/drivers/usb/host/ohci-exynos.c
index bd40e597f..5f5e8a64c 100644
--- a/drivers/usb/host/ohci-exynos.c
+++ b/drivers/usb/host/ohci-exynos.c
@@ -171,9 +171,8 @@ static int exynos_ohci_probe(struct platform_device *pdev)
hcd->rsrc_len = resource_size(res);

irq = platform_get_irq(pdev, 0);
- if (!irq) {
- dev_err(&pdev->dev, "Failed to get IRQ\n");
- err = -ENODEV;
+ if (irq < 0) {
+ err = irq;
goto fail_io;
}

--
2.20.1.windows.1




2020-08-27 06:54:13

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH] usb: host: ohci-exynos: Fix error handling in exynos_ohci_probe()

On Wed, Aug 26, 2020 at 10:49:31PM +0800, Tang Bin wrote:
> If the function platform_get_irq() failed, the negative value
> returned will not be detected here. So fix error handling in
> exynos_ohci_probe(). And when get irq failed, the function
> platform_get_irq() logs an error message, so remove redundant
> message here.
>
> Fixes: 62194244cf87 ("USB: Add Samsung Exynos OHCI diver")
> Signed-off-by: Zhang Shengju <[email protected]>
> Signed-off-by: Tang Bin <[email protected]>
> ---
> drivers/usb/host/ohci-exynos.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof