]> git.dujemihanovic.xyz Git - linux.git/commitdiff
power: supply: generic-adc-battery: improve error message
authorSebastian Reichel <sre@kernel.org>
Fri, 17 Mar 2023 22:57:06 +0000 (23:57 +0100)
committerSebastian Reichel <sre@kernel.org>
Wed, 29 Mar 2023 20:38:57 +0000 (22:38 +0200)
Add device context and error code to the error messages to make it
useful.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/generic-adc-battery.c

index df1c0a1c6b5240a4e52a0e9413eee5e20bb54ce2..2fa946c93fb470e8994ae67d03f53347ae1b0e29 100644 (file)
@@ -92,7 +92,7 @@ static int read_channel(struct gab *adc_bat, enum gab_chan_type channel,
 
        ret = iio_read_channel_processed(adc_bat->channel[channel], result);
        if (ret < 0)
-               pr_err("read channel error\n");
+               dev_err(&adc_bat->psy->dev, "read channel error: %d\n", ret);
        else
                *result *= 1000;