linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][next] power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails
@ 2020-01-16 17:09 Colin King
  2020-01-16 19:38 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-01-16 17:09 UTC (permalink / raw)
  To: Sebastian Reichel, Yauhen Kharuzhy, linux-pm
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently a read failure by bq25890_field_read on F_DEV_REV is returning
an error in id instead of rev. Fix this by returning the value in rev.

Addresses-Coverity: ("Copy-paste error")
Fixes: d20267c9a98e ("power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/power/supply/bq25890_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index 785dbc6307b0..aebd1253dbc9 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -765,7 +765,7 @@ static int bq25890_get_chip_version(struct bq25890_device *bq)
 	rev = bq25890_field_read(bq, F_DEV_REV);
 	if (rev < 0) {
 		dev_err(bq->dev, "Cannot read chip revision.\n");
-		return id;
+		return rev;
 	}
 
 	switch (id) {
-- 
2.24.0


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

* Re: [PATCH][next] power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails
  2020-01-16 17:09 [PATCH][next] power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails Colin King
@ 2020-01-16 19:38 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2020-01-16 19:38 UTC (permalink / raw)
  To: Colin King; +Cc: Yauhen Kharuzhy, linux-pm, kernel-janitors, linux-kernel

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

Hi Colin,

Thanks, queued.

-- Sebastian

On Thu, Jan 16, 2020 at 05:09:00PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Currently a read failure by bq25890_field_read on F_DEV_REV is returning
> an error in id instead of rev. Fix this by returning the value in rev.
> 
> Addresses-Coverity: ("Copy-paste error")
> Fixes: d20267c9a98e ("power: supply: bq25890_charger: Add support of BQ25892 and BQ25896 chips")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/power/supply/bq25890_charger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
> index 785dbc6307b0..aebd1253dbc9 100644
> --- a/drivers/power/supply/bq25890_charger.c
> +++ b/drivers/power/supply/bq25890_charger.c
> @@ -765,7 +765,7 @@ static int bq25890_get_chip_version(struct bq25890_device *bq)
>  	rev = bq25890_field_read(bq, F_DEV_REV);
>  	if (rev < 0) {
>  		dev_err(bq->dev, "Cannot read chip revision.\n");
> -		return id;
> +		return rev;
>  	}
>  
>  	switch (id) {
> -- 
> 2.24.0
> 

[-- 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:[~2020-01-16 19:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-16 17:09 [PATCH][next] power: supply: bq25890_charger: fix incorrect error return when bq25890_field_read fails Colin King
2020-01-16 19:38 ` Sebastian Reichel

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).