Re: [PATCH 1/2] clk: hisilicon: Use correct return value about hisi_reset_init()

From: Tiezhu Yang
Date: Tue May 26 2020 - 22:49:25 EST


On 05/27/2020 07:02 AM, Stephen Boyd wrote:
Quoting Tiezhu Yang (2020-05-24 20:31:55)
The return value about hisi_reset_init() is not correct, fix it.

Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
drivers/clk/hisilicon/clk-hi3519.c | 4 ++--
drivers/clk/hisilicon/crg-hi3516cv300.c | 4 ++--
drivers/clk/hisilicon/crg-hi3798cv200.c | 4 ++--
drivers/clk/hisilicon/reset.c | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/hisilicon/clk-hi3519.c b/drivers/clk/hisilicon/clk-hi3519.c
index ad0c7f3..803fa66 100644
--- a/drivers/clk/hisilicon/clk-hi3519.c
+++ b/drivers/clk/hisilicon/clk-hi3519.c
@@ -149,8 +149,8 @@ static int hi3519_clk_probe(struct platform_device *pdev)
return -ENOMEM;
crg->rstc = hisi_reset_init(pdev);
- if (!crg->rstc)
- return -ENOMEM;
+ if (IS_ERR(crg->rstc))
+ return PTR_ERR(crg->rstc);
crg->clk_data = hi3519_clk_register(pdev);
if (IS_ERR(crg->clk_data)) {
The code I see is returning NULL or a valid pointer from
hisi_reset_init(). Can you add a "Fixes" tag to this patch so we can
figure out which patch changed the behavior and where this patch needs
to be backported to?

OK, I will check the git log to add a Fixes tag and then send v2.

Thanks,
Tiezhu Yang