[U-Boot] [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") Reported-by: Nishanth Menon nm@ti.com Signed-off-by: Keerthy j-keerthy@ti.com --- drivers/power/regulator/lp87565_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/lp87565_regulator.c b/drivers/power/regulator/lp87565_regulator.c index 2a0b8ca..e5de578 100644 --- a/drivers/power/regulator/lp87565_regulator.c +++ b/drivers/power/regulator/lp87565_regulator.c @@ -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; }

The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com --- drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/lp873x_regulator.c b/drivers/power/regulator/lp873x_regulator.c index dcb19ff..149a36d 100644 --- a/drivers/power/regulator/lp873x_regulator.c +++ b/drivers/power/regulator/lp873x_regulator.c @@ -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; }

On 10 June 2017 at 23:01, Keerthy j-keerthy@ti.com wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
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 :-)

On Tuesday 13 June 2017 05:21 AM, Simon Glass wrote:
On 10 June 2017 at 23:01, Keerthy j-keerthy@ti.com wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
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.

On Tuesday 13 June 2017 09:04 AM, Keerthy wrote:
On Tuesday 13 June 2017 05:21 AM, Simon Glass wrote:
On 10 June 2017 at 23:01, Keerthy j-keerthy@ti.com wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
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
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.
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot

The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com --- drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/lp873x_regulator.c b/drivers/power/regulator/lp873x_regulator.c index 149a36d..8c26baf 100644 --- a/drivers/power/regulator/lp873x_regulator.c +++ b/drivers/power/regulator/lp873x_regulator.c @@ -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; }

On 06/11/2017 12:01 AM, Keerthy wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/lp873x_regulator.c b/drivers/power/regulator/lp873x_regulator.c index 149a36d..8c26baf 100644 --- a/drivers/power/regulator/lp873x_regulator.c +++ b/drivers/power/regulator/lp873x_regulator.c @@ -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?

On Monday 12 June 2017 07:09 PM, Nishanth Menon wrote:
On 06/11/2017 12:01 AM, Keerthy wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 99785de83 ("power: regulator: lp873x: Add regulator support") Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp873x_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/lp873x_regulator.c b/drivers/power/regulator/lp873x_regulator.c index 149a36d..8c26baf 100644 --- a/drivers/power/regulator/lp873x_regulator.c +++ b/drivers/power/regulator/lp873x_regulator.c @@ -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.

On 10 June 2017 at 23:01, Keerthy j-keerthy@ti.com wrote:
The function wrongly returned an integer while it is supposed to return boolean. Fix that.
Fixes: 2dd9dc02a3("power: regulator: lp87565: add regulator support") Reported-by: Nishanth Menon nm@ti.com Signed-off-by: Keerthy j-keerthy@ti.com
drivers/power/regulator/lp87565_regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Simon Glass sjg@chromium.org
participants (3)
-
Keerthy
-
Nishanth Menon
-
Simon Glass