diff mbox series

[1/2] clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap_lookup_by_phandle()

Message ID b7fbe8776703b9d637ab82ad4724353b359f1d04.1569555841.git.baolin.wang@linaro.org (mailing list archive)
State Superseded, archived
Headers show
Series [1/2] clk: sprd: Use IS_ERR() to validate the return value of syscon_regmap_lookup_by_phandle() | expand

Commit Message

(Exiting) Baolin Wang Sept. 27, 2019, 3:50 a.m. UTC
The syscon_regmap_lookup_by_phandle() will never return NULL, thus use
IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().

Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
 drivers/clk/sprd/common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stephen Boyd Sept. 27, 2019, 6:45 p.m. UTC | #1
Quoting Baolin Wang (2019-09-26 20:50:53)
> The syscon_regmap_lookup_by_phandle() will never return NULL, thus use
> IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().
> 
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> ---
>  drivers/clk/sprd/common.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Fixes tag?
(Exiting) Baolin Wang Sept. 29, 2019, 2:30 a.m. UTC | #2
Hi Stephen,

On Sat, 28 Sep 2019 at 02:45, Stephen Boyd <sboyd@kernel.org> wrote:
>
> Quoting Baolin Wang (2019-09-26 20:50:53)
> > The syscon_regmap_lookup_by_phandle() will never return NULL, thus use
> > IS_ERR() to validate the return value instead of IS_ERR_OR_NULL().
> >
> > Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
> > ---
> >  drivers/clk/sprd/common.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Fixes tag?

Yes, the fixes tag should be:
Fixes: d41f59fd92f2 ("clk: sprd: Add common infrastructure")

Do I need to resend this patch with adding the fixes tag?
diff mbox series

Patch

diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
index 9d56eac..7ad5ba2 100644
--- a/drivers/clk/sprd/common.c
+++ b/drivers/clk/sprd/common.c
@@ -46,7 +46,7 @@  int sprd_clk_regmap_init(struct platform_device *pdev,
 
 	if (of_find_property(node, "sprd,syscon", NULL)) {
 		regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
-		if (IS_ERR_OR_NULL(regmap)) {
+		if (IS_ERR(regmap)) {
 			pr_err("%s: failed to get syscon regmap\n", __func__);
 			return PTR_ERR(regmap);
 		}