Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH 1/2] power: supply: ab8500_charger: Fix an error handling path
@ 2017-11-22 20:27 Christophe JAILLET
  2017-12-01 15:29 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-11-22 20:27 UTC (permalink / raw)
  To: sre; +Cc: linux-pm, linux-kernel, kernel-janitors, Christophe JAILLET

'ret' is know to be 0 at this point, because it has not been updated by the
the previous call to 'abx500_mask_and_set_register_interruptible()'.

Fix it by updating 'ret' before checking if an error occurred.

Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/power/supply/ab8500_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
index 4ebbcce45c48..1cdbe7a0738d 100644
--- a/drivers/power/supply/ab8500_charger.c
+++ b/drivers/power/supply/ab8500_charger.c
@@ -3218,7 +3218,7 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
 	}
 
 	/* Enable backup battery charging */
-	abx500_mask_and_set_register_interruptible(di->dev,
+	ret = abx500_mask_and_set_register_interruptible(di->dev,
 		AB8500_RTC, AB8500_RTC_CTRL_REG,
 		RTC_BUP_CH_ENA, RTC_BUP_CH_ENA);
 	if (ret < 0)
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/2] power: supply: ab8500_charger: Fix an error handling path
  2017-11-22 20:27 [PATCH 1/2] power: supply: ab8500_charger: Fix an error handling path Christophe JAILLET
@ 2017-12-01 15:29 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2017-12-01 15:29 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: linux-pm, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 1200 bytes --]

Hi,

On Wed, Nov 22, 2017 at 09:27:31PM +0100, Christophe JAILLET wrote:
> 'ret' is know to be 0 at this point, because it has not been updated by the
> the previous call to 'abx500_mask_and_set_register_interruptible()'.
> 
> Fix it by updating 'ret' before checking if an error occurred.
> 
> Fixes: 84edbeeab67c ("ab8500-charger: AB8500 charger driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---

Thanks, queued.

-- Sebastian

>  drivers/power/supply/ab8500_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
> index 4ebbcce45c48..1cdbe7a0738d 100644
> --- a/drivers/power/supply/ab8500_charger.c
> +++ b/drivers/power/supply/ab8500_charger.c
> @@ -3218,7 +3218,7 @@ static int ab8500_charger_init_hw_registers(struct ab8500_charger *di)
>  	}
>  
>  	/* Enable backup battery charging */
> -	abx500_mask_and_set_register_interruptible(di->dev,
> +	ret = abx500_mask_and_set_register_interruptible(di->dev,
>  		AB8500_RTC, AB8500_RTC_CTRL_REG,
>  		RTC_BUP_CH_ENA, RTC_BUP_CH_ENA);
>  	if (ret < 0)
> -- 
> 2.14.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-01 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-22 20:27 [PATCH 1/2] power: supply: ab8500_charger: Fix an error handling path Christophe JAILLET
2017-12-01 15:29 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox