Skip to contentSkip to conversation

regulator: lp87565: Fix the return value of buck_get_enable function

PATCH Superseded Keerthy 3 participants 9 messages Jun 11, 2017 – Jun 15, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Keerthy

author
#0 lore raw

PATCH 1/3 regulator: lp87565: Fix the return value of buck_get_enable function

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 2dd9dc02a3("power: regulator: lp87565: add regulator support")
---
 drivers/power/regulator/lp87565_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/lp87565_regulator.c +1 -1
index 2a0b8ca..e5de578 100644
@@ -174,7 +174,7 @@ static bool buck_get_enable(struct udevice *dev)
 
 	ret = lp87565_buck_enable(dev, PMIC_OP_GET, &enable);
 	if (ret)
-		return ret;
+		return false;
 
 	return enable;
 }
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 2/3 regulator: lp873x: Fix the return value of ldo_get_enable function

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
 drivers/power/regulator/lp873x_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/lp873x_regulator.c +1 -1
index dcb19ff..149a36d 100644
@@ -263,7 +263,7 @@ static bool ldo_get_enable(struct udevice *dev)
 
 	ret = lp873x_ldo_enable(dev, PMIC_OP_GET, &enable);
 	if (ret)
-		return ret;
+		return false;
 
 	return enable;
 }
Signature · 1 line
1.9.1
author
#5 lore raw

PATCH 3/3 regulator: lp873x: Fix the return value of buck_get_enable function

In reply to Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
 drivers/power/regulator/lp873x_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/lp873x_regulator.c +1 -1
index 149a36d..8c26baf 100644
@@ -318,7 +318,7 @@ static bool buck_get_enable(struct udevice *dev)
 
 	ret = lp873x_buck_enable(dev, PMIC_OP_GET, &enable);
 	if (ret)
-		return ret;
+		return false;
 
 	return enable;
 }
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/3 regulator: lp873x: Fix the return value of buck_get_enable function

Quoted 15 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
  drivers/power/regulator/lp873x_regulator.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/regulator/lp873x_regulator.c +0 -0
index 149a36d..8c26baf 100644

drivers/power/regulator/lp873x_regulator.c static bool buck_get_enable(struct udevice *dev) · line 324

Quoted 8 lines
drivers/power/regulator/lp873x_regulator.c +1 -1
@@ -318,7 +318,7 @@ static bool buck_get_enable(struct udevice *dev)
 
  	ret = lp873x_buck_enable(dev, PMIC_OP_GET, &enable);
  	if (ret)
-		return ret;
+		return false;
 
  	return enable;
  }

just squash 2/3 and 3/3 to a single patch?

Signature · 2 lines
Regards,
Nishanth Menon
author
#7 lore raw

PATCH 3/3 regulator: lp873x: Fix the return value of buck_get_enable function

Quoted 10 lines · Nishanth Menon
Quoted 9 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
  drivers/power/regulator/lp873x_regulator.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines

drivers/power/regulator/lp873x_regulator.c static bool buck_get_enable(struct udevice *dev) · line 323

Quoted 13 lines
drivers/power/regulator/lp873x_regulator.c +1 -1
index 149a36d..8c26baf 100644
@@ -318,7 +318,7 @@ static bool buck_get_enable(struct udevice *dev)
        ret = lp873x_buck_enable(dev, PMIC_OP_GET, &enable);
      if (ret)
-        return ret;
+        return false;
        return enable;
  }
 

just squash 2/3 and 3/3 to a single patch?

Yes. Sent a v2 with both squashed into 1 patch.

Quoted 1 line
#8 lore raw

PATCH 1/3 regulator: lp87565: Fix the return value of buck_get_enable function

In reply to Keerthy
Quoted 9 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 2dd9dc02a3("power: regulator: lp87565: add regulator support")
---
 drivers/power/regulator/lp87565_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 2/3 regulator: lp873x: Fix the return value of ldo_get_enable function

In reply to Keerthy
Quoted 9 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
 drivers/power/regulator/lp873x_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I think in fact we should return int from this method in struct dm_regulator_ops. I don't really like not being able to return an error.

So bonus points if you can change that :-)

author
#3 lore raw

PATCH 2/3 regulator: lp873x: Fix the return value of ldo_get_enable function

Quoted 11 lines · Simon Glass
Quoted 9 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
 drivers/power/regulator/lp873x_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines

I think in fact we should return int from this method in struct dm_regulator_ops. I don't really like not being able to return an error.

So bonus points if you can change that :-)

I did not touch it as it was being used at many places. Seems like that is the right thing to do. I believe this series can be discarded. I will post a series where in all are changed to return int.

Quoted 1 line
author
#4 lore raw

PATCH 2/3 regulator: lp873x: Fix the return value of ldo_get_enable function

Quoted 14 lines · Keerthy
Quoted 11 lines · Simon Glass
Quoted 9 lines · Keerthy

The function wrongly returned an integer while it is supposed to return boolean. Fix that.

Fixes 99785de83 ("power: regulator: lp873x: Add regulator support")
---
 drivers/power/regulator/lp873x_regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 7 lines

I think in fact we should return int from this method in struct dm_regulator_ops. I don't really like not being able to return an error.

So bonus points if you can change that :-)

Simon,

https://lists.denx.de/pipermail/u-boot/2017-June/295326.html

For changing the return type.

Regards,
Keerthy

Quoted 12 lines

I did not touch it as it was being used at many places. Seems like that is the right thing to do. I believe this series can be discarded. I will post a series where in all are changed to return int.

Quoted 1 line

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot