clk: Fix return value check in oxnas_stdclk_probe()
PATCH 1/1 clk: Fix return value check in oxnas_stdclk_probe()
From: Wei Yongjun <[email protected]>
In case of error, the function syscon_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
--- drivers/clk/clk-oxnas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/clk-oxnas.c +2 -2
@@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)return -ENOMEM ; regmap =syscon_node_to_regmap (of_get_parent (np)); -if (!regmap) { +if (IS_ERR (regmap)) {dev_err (&pdev->dev,"failed to have parent regmap\n" ); -return -EINVAL ; +return PTR_ERR (regmap); }for (i =0 ; i <ARRAY_SIZE (clk_oxnas_init); i++) {
PATCH 1/1 clk: Fix return value check in oxnas_stdclk_probe()
Quoted 20 lines · On 06/17/2016 07:24 PM, weiyj_lk at 163.com wrote:
From: Wei Yongjun <[email protected]>
In case of error, the function
syscon_node_to_regmap()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Signed-off-by Wei Yongjun <[email protected]>--- drivers/clk/clk-oxnas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/clk/clk-oxnas.c +0
-0@@ -144,9 +144,9 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)return -ENOMEM ;
drivers/clk/clk-oxnas.c static int oxnas_stdclk_probe(struct platform_device *pdev) · line 152
Quoted 10 lines
drivers/clk/clk-oxnas.c +2
-2regmap =syscon_node_to_regmap (of_get_parent (np)); -if (!regmap) { +if (IS_ERR (regmap)) {dev_err (&pdev->dev,"failed to have parent regmap\n" ); -return -EINVAL ; +return PTR_ERR (regmap); }for (i =0 ; i <ARRAY_SIZE (clk_oxnas_init); i++) {
Correct.
Thanks,
Neil
Stephen Boyd
AppliedPATCH 1/1 clk: Fix return value check in oxnas_stdclk_probe()
In reply to weiyj_lk at 163.comQuoted 8 lines · On 06/17, weiyj_lk at 163.com wrote:
From: Wei Yongjun <[email protected]>
In case of error, the function
syscon_node_to_regmap()returnsERR_PTR()and never returns NULL. The NULL test in the return value check should be replaced withIS_ERR().Signed-off-by Wei Yongjun <[email protected]>---
Applied to clk-fixes + added fixes tag.
Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project