* [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable
@ 2013-09-06 8:01 Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 2/4] ab8500-charger: Remove redundant break Sachin Kamat
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-09-06 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: anton, dwmw2, lee.jones, sachin.kamat
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 <sachin.kamat@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v3 2/4] ab8500-charger: Remove redundant break
2013-09-06 8:01 [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Sachin Kamat
@ 2013-09-06 8:01 ` Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable Sachin Kamat
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-09-06 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: anton, dwmw2, lee.jones, sachin.kamat
Each of the if-else blocks has a break statement.
Remove the additional one which is unreachable.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable
2013-09-06 8:01 [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 2/4] ab8500-charger: Remove redundant break Sachin Kamat
@ 2013-09-06 8:01 ` Sachin Kamat
2013-09-06 9:37 ` Lee Jones
2013-09-06 8:01 ` [PATCH v3 4/4] pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt Sachin Kamat
2013-09-06 9:38 ` [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Lee Jones
3 siblings, 1 reply; 8+ messages in thread
From: Sachin Kamat @ 2013-09-06 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: anton, dwmw2, lee.jones, sachin.kamat
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 <sachin.kamat@linaro.org>
Cc: Lee Jones <lee.jones@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable
2013-09-06 8:01 ` [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable Sachin Kamat
@ 2013-09-06 9:37 ` Lee Jones
0 siblings, 0 replies; 8+ messages in thread
From: Lee Jones @ 2013-09-06 9:37 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel, anton, dwmw2
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 <sachin.kamat@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> ---
> 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 <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v3 4/4] pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt
2013-09-06 8:01 [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 2/4] ab8500-charger: Remove redundant break Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable Sachin Kamat
@ 2013-09-06 8:01 ` Sachin Kamat
2013-09-06 9:38 ` [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Lee Jones
3 siblings, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-09-06 8:01 UTC (permalink / raw)
To: linux-kernel; +Cc: anton, dwmw2, lee.jones, sachin.kamat
pm2xxx_charger_die_therm_mngt is used only in this file.
Make it static.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
---
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
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable
2013-09-06 8:01 [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Sachin Kamat
` (2 preceding siblings ...)
2013-09-06 8:01 ` [PATCH v3 4/4] pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt Sachin Kamat
@ 2013-09-06 9:38 ` Lee Jones
2013-10-21 8:35 ` Sachin Kamat
2013-10-25 22:37 ` Anton Vorontsov
3 siblings, 2 replies; 8+ messages in thread
From: Lee Jones @ 2013-09-06 9:38 UTC (permalink / raw)
To: Sachin Kamat; +Cc: linux-kernel, anton, dwmw2
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 <sachin.kamat@linaro.org>
> Cc: Lee Jones <lee.jones@linaro.org>
> ---
> 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 <lee.jones@linaro.org>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable
2013-09-06 9:38 ` [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Lee Jones
@ 2013-10-21 8:35 ` Sachin Kamat
2013-10-25 22:37 ` Anton Vorontsov
1 sibling, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-10-21 8:35 UTC (permalink / raw)
Cc: LKML, anton, David Woodhouse
On 6 September 2013 15:08, Lee Jones <lee.jones@linaro.org> 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 <sachin.kamat@linaro.org>
>> Cc: Lee Jones <lee.jones@linaro.org>
>> ---
>> 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 <lee.jones@linaro.org>
>
Ping on this series, Anton..
--
With warm regards,
Sachin
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable
2013-09-06 9:38 ` [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Lee Jones
2013-10-21 8:35 ` Sachin Kamat
@ 2013-10-25 22:37 ` Anton Vorontsov
1 sibling, 0 replies; 8+ messages in thread
From: Anton Vorontsov @ 2013-10-25 22:37 UTC (permalink / raw)
To: Lee Jones; +Cc: Sachin Kamat, linux-kernel, dwmw2
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 <sachin.kamat@linaro.org>
> > Cc: Lee Jones <lee.jones@linaro.org>
> > ---
> > 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 <lee.jones@linaro.org>
Applied, thanks a lot for the patches and reviews!
Anton
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-10-25 22:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-06 8:01 [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 2/4] ab8500-charger: Remove redundant break Sachin Kamat
2013-09-06 8:01 ` [PATCH v3 3/4] pm2301-charger: Check return value of regulator_enable Sachin Kamat
2013-09-06 9:37 ` Lee Jones
2013-09-06 8:01 ` [PATCH v3 4/4] pm2301-charger: Staticize pm2xxx_charger_die_therm_mngt Sachin Kamat
2013-09-06 9:38 ` [PATCH v3 1/4] ab8500-charger: Check return value of regulator_enable Lee Jones
2013-10-21 8:35 ` Sachin Kamat
2013-10-25 22:37 ` Anton Vorontsov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).