Check the return value of regulator_enable to silence the following
type of warnings:
drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
of ‘regulator_enable’, declared with attribute warn_unused_result
[-Wunused-result]
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Lee Jones <[email protected]>
---
Compile tested.
Changes since v2:
* removed redundant assignment to false.
Changes since v1:
* converted dev_err and return to dev_warn as suggested by Lee Jones.
---
drivers/power/ab8500_charger.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index a4c4a10..fd35018 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -1387,8 +1387,12 @@ static int ab8500_charger_ac_en(struct ux500_charger *charger,
* the GPADC module independant of the AB8500 chargers
*/
if (!di->vddadc_en_ac) {
- regulator_enable(di->regu);
- di->vddadc_en_ac = true;
+ ret = regulator_enable(di->regu);
+ if (ret)
+ dev_warn(di->dev,
+ "Failed to enable regulator\n");
+ else
+ di->vddadc_en_ac = true;
}
/* Check if the requested voltage or current is valid */
@@ -1556,8 +1560,12 @@ static int ab8500_charger_usb_en(struct ux500_charger *charger,
* the GPADC module independant of the AB8500 chargers
*/
if (!di->vddadc_en_usb) {
- regulator_enable(di->regu);
- di->vddadc_en_usb = true;
+ ret = regulator_enable(di->regu);
+ if (ret)
+ dev_warn(di->dev,
+ "Failed to enable regulator\n");
+ else
+ di->vddadc_en_usb = true;
}
/* Enable USB charging */
--
1.7.9.5
Each of the if-else blocks has a break statement.
Remove the additional one which is unreachable.
Signed-off-by: Sachin Kamat <[email protected]>
Acked-by: Lee Jones <[email protected]>
---
No changes since v1.
---
drivers/power/ab8500_charger.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c
index fd35018..19110aa 100644
--- a/drivers/power/ab8500_charger.c
+++ b/drivers/power/ab8500_charger.c
@@ -766,7 +766,6 @@ static int ab8500_charger_max_usb_curr(struct ab8500_charger *di,
ret = -ENXIO;
break;
}
- break;
case USB_STAT_CARKIT_1:
case USB_STAT_CARKIT_2:
case USB_STAT_ACA_DOCK_CHARGER:
--
1.7.9.5
pm2xxx_charger_die_therm_mngt is used only in this file.
Make it static.
Signed-off-by: Sachin Kamat <[email protected]>
Acked-by: Lee Jones <[email protected]>
---
No changes since v1.
---
drivers/power/pm2301_charger.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c
index 7214b66..b733c69 100644
--- a/drivers/power/pm2301_charger.c
+++ b/drivers/power/pm2301_charger.c
@@ -205,7 +205,7 @@ static int pm2xxx_charger_batt_therm_mngt(struct pm2xxx_charger *pm2, int val)
}
-int pm2xxx_charger_die_therm_mngt(struct pm2xxx_charger *pm2, int val)
+static int pm2xxx_charger_die_therm_mngt(struct pm2xxx_charger *pm2, int val)
{
queue_work(pm2->charger_wq, &pm2->check_main_thermal_prot_work);
--
1.7.9.5
Check the return value of regulator_enable to silence the following
warning:
drivers/power/pm2301_charger.c:725:20: warning:
ignoring return value of ‘regulator_enable’, declared with
attribute warn_unused_result [-Wunused-result]
Signed-off-by: Sachin Kamat <[email protected]>
Cc: Lee Jones <[email protected]>
---
Compile tested.
Changes since v2:
* removed redundant assignment to false.
Changes since v1:
* converted dev_err and return to dev_warn as suggested by Lee Jones.
---
drivers/power/pm2301_charger.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/power/pm2301_charger.c b/drivers/power/pm2301_charger.c
index ffa10ed..7214b66 100644
--- a/drivers/power/pm2301_charger.c
+++ b/drivers/power/pm2301_charger.c
@@ -722,8 +722,12 @@ static int pm2xxx_charger_ac_en(struct ux500_charger *charger,
dev_dbg(pm2->dev, "Enable AC: %dmV %dmA\n", vset, iset);
if (!pm2->vddadc_en_ac) {
- regulator_enable(pm2->regu);
- pm2->vddadc_en_ac = true;
+ ret = regulator_enable(pm2->regu);
+ if (ret)
+ dev_warn(pm2->dev,
+ "Failed to enable vddadc regulator\n");
+ else
+ pm2->vddadc_en_ac = true;
}
ret = pm2xxx_charging_init(pm2);
--
1.7.9.5
On Fri, 06 Sep 2013, Sachin Kamat wrote:
> Check the return value of regulator_enable to silence the following
> warning:
> drivers/power/pm2301_charger.c:725:20: warning:
> ignoring return value of ‘regulator_enable’, declared with
> attribute warn_unused_result [-Wunused-result]
>
> Signed-off-by: Sachin Kamat <[email protected]>
> Cc: Lee Jones <[email protected]>
> ---
> Compile tested.
> Changes since v2:
> * removed redundant assignment to false.
> Changes since v1:
> * converted dev_err and return to dev_warn as suggested by Lee Jones.
> ---
> drivers/power/pm2301_charger.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Looks good now.
Acked-by: Lee Jones <[email protected]>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
On Fri, 06 Sep 2013, Sachin Kamat wrote:
> Check the return value of regulator_enable to silence the following
> type of warnings:
> drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
> of ‘regulator_enable’, declared with attribute warn_unused_result
> [-Wunused-result]
>
> Signed-off-by: Sachin Kamat <[email protected]>
> Cc: Lee Jones <[email protected]>
> ---
> Compile tested.
>
> Changes since v2:
> * removed redundant assignment to false.
> Changes since v1:
> * converted dev_err and return to dev_warn as suggested by Lee Jones.
> ---
>
> drivers/power/ab8500_charger.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
Looks good now.
Acked-by: Lee Jones <[email protected]>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
On 6 September 2013 15:08, Lee Jones <[email protected]> wrote:
> On Fri, 06 Sep 2013, Sachin Kamat wrote:
>
>> Check the return value of regulator_enable to silence the following
>> type of warnings:
>> drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
>> of ?regulator_enable?, declared with attribute warn_unused_result
>> [-Wunused-result]
>>
>> Signed-off-by: Sachin Kamat <[email protected]>
>> Cc: Lee Jones <[email protected]>
>> ---
>> Compile tested.
>>
>> Changes since v2:
>> * removed redundant assignment to false.
>> Changes since v1:
>> * converted dev_err and return to dev_warn as suggested by Lee Jones.
>> ---
>>
>> drivers/power/ab8500_charger.c | 16 ++++++++++++----
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> Looks good now.
>
> Acked-by: Lee Jones <[email protected]>
>
Ping on this series, Anton..
--
With warm regards,
Sachin
On Fri, Sep 06, 2013 at 10:38:00AM +0100, Lee Jones wrote:
> On Fri, 06 Sep 2013, Sachin Kamat wrote:
>
> > Check the return value of regulator_enable to silence the following
> > type of warnings:
> > drivers/power/ab8500_charger.c:1390:20: warning: ignoring return value
> > of ‘regulator_enable’, declared with attribute warn_unused_result
> > [-Wunused-result]
> >
> > Signed-off-by: Sachin Kamat <[email protected]>
> > Cc: Lee Jones <[email protected]>
> > ---
> > Compile tested.
> >
> > Changes since v2:
> > * removed redundant assignment to false.
> > Changes since v1:
> > * converted dev_err and return to dev_warn as suggested by Lee Jones.
> > ---
> >
> > drivers/power/ab8500_charger.c | 16 ++++++++++++----
> > 1 file changed, 12 insertions(+), 4 deletions(-)
>
> Looks good now.
>
> Acked-by: Lee Jones <[email protected]>
Applied, thanks a lot for the patches and reviews!
Anton