Skip to contentSkip to conversation

mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk

PATCH RESEND Applied Axel Lin 3 participants 5 messages Jun 26, 2019 – Jun 27, 2019 Multifunction devices (MFD)

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH RESEND 1/1 mfd: hi655x-pmic: Fix missing return value check for devm_regmap_init_mmio_clk

Since devm_regmap_init_mmio_clk can fail, add return value checking.

---
This was sent on https://lkml.org/lkml/2019/3/6/904

 drivers/mfd/hi655x-pmic.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mfd/hi655x-pmic.c +2 -0
index 96c07fa1802a..6693f74aa6ab 100644
@@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
 
 	pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
 						 &hi655x_regmap_config);
+	if (IS_ERR(pmic->regmap))
+		return PTR_ERR(pmic->regmap);
 
 	regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
 	if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
Signature · 1 line
2.17.1
#1 lore raw

Thanks

Quoted 24 lines · Axel Lin

Since devm_regmap_init_mmio_clk can fail, add return value checking.

---
This was sent on https://lkml.org/lkml/2019/3/6/904

  drivers/mfd/hi655x-pmic.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/mfd/hi655x-pmic.c +2 -0
index 96c07fa1802a..6693f74aa6ab 100644
@@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
 
  	pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
  						 &hi655x_regmap_config);
+	if (IS_ERR(pmic->regmap))
+		return PTR_ERR(pmic->regmap);
 
  	regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
  	if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
author
#2 lore raw

Hi Chen,

Chen Feng <[email protected]> 於 2019年6月27日 週四 上午10:03寫道:

Quoted 2 lines

Thanks

I assume this is an Ack.
If you can add your Acked-by in the reply, it's easier for maintainer to accept the patch.

Quoted 27 lines · Axel Lin
Quoted 24 lines

Since devm_regmap_init_mmio_clk can fail, add return value checking.

---
This was sent on https://lkml.org/lkml/2019/3/6/904

  drivers/mfd/hi655x-pmic.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/mfd/hi655x-pmic.c +2 -0
index 96c07fa1802a..6693f74aa6ab 100644
@@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
 
      pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
                                               &hi655x_regmap_config);
+     if (IS_ERR(pmic->regmap))
+             return PTR_ERR(pmic->regmap);
 
      regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
      if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
#3 lore raw
Quoted 8 lines · Axel Lin

Hi Chen,

Chen Feng <[email protected]> 於 2019年6月27日 週四 上午10:03寫道:

Quoted 2 lines

Thanks

I assume this is an Ack.
If you can add your Acked-by in the reply, it's easier for maintainer to accept the patch.

Looks to me like he already Acked it.

Which is looks like you already applied?

Quoted 26 lines
Quoted 26 lines · Axel Lin
Quoted 24 lines

Since devm_regmap_init_mmio_clk can fail, add return value checking.

---
This was sent on https://lkml.org/lkml/2019/3/6/904

  drivers/mfd/hi655x-pmic.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/mfd/hi655x-pmic.c +2 -0
index 96c07fa1802a..6693f74aa6ab 100644
@@ -112,6 +112,8 @@ static int hi655x_pmic_probe(struct platform_device *pdev)
 
      pmic->regmap = devm_regmap_init_mmio_clk(dev, NULL, base,
                                               &hi655x_regmap_config);
+     if (IS_ERR(pmic->regmap))
+             return PTR_ERR(pmic->regmap);
 
      regmap_read(pmic->regmap, HI655X_BUS_ADDR(HI655X_VER_REG), &pmic->ver);
      if ((pmic->ver < PMU_VER_START) || (pmic->ver > PMU_VER_END)) {
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Applied
#4 lore raw
In reply to Axel Lin
Quoted 9 lines · Axel Lin

Since devm_regmap_init_mmio_clk can fail, add return value checking.

---
This was sent on https://lkml.org/lkml/2019/3/6/904

 drivers/mfd/hi655x-pmic.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog