2021-09-06 05:29:21

by zhaoxiao

[permalink] [raw]
Subject: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()

When call function devm_platform_ioremap_resource(), we should use IS_ERR()
to check the return value and return PTR_ERR() if failed.

Signed-off-by: zhaoxiao <[email protected]>
---
drivers/i2c/busses/i2c-bcm-kona.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-bcm-kona.c b/drivers/i2c/busses/i2c-bcm-kona.c
index ed5e1275ae46..8e350f20cde0 100644
--- a/drivers/i2c/busses/i2c-bcm-kona.c
+++ b/drivers/i2c/busses/i2c-bcm-kona.c
@@ -763,7 +763,7 @@ static int bcm_kona_i2c_probe(struct platform_device *pdev)
/* Map hardware registers */
dev->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(dev->base))
- return -ENOMEM;
+ return PTR_ERR(dev->base);

/* Get and enable external clock */
dev->external_clk = devm_clk_get(dev->device, NULL);
--
2.20.1


2021-09-16 00:09:51

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()



On 9/5/2021 10:27 PM, zhaoxiao wrote:
> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
> to check the return value and return PTR_ERR() if failed.
>
> Signed-off-by: zhaoxiao <[email protected]>

Acked-by: Florian Fainelli <[email protected]>
--
Florian

2021-09-29 22:27:51

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] i2c: Fix return value of bcm_kona_i2c_probe()

On Mon, Sep 06, 2021 at 01:27:30PM +0800, zhaoxiao wrote:
> When call function devm_platform_ioremap_resource(), we should use IS_ERR()
> to check the return value and return PTR_ERR() if failed.
>
> Signed-off-by: zhaoxiao <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (287.00 B)
signature.asc (849.00 B)
Download all attachments