* [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe
@ 2021-07-01 22:05 Peter Robinson
2021-07-01 22:14 ` Javier Martinez Canillas
0 siblings, 1 reply; 3+ messages in thread
From: Peter Robinson @ 2021-07-01 22:05 UTC (permalink / raw)
To: Tobias Schrammm, Sebastian Reichel, linux-pm, linux-arm-kernel
Cc: Peter Robinson
Deal with deferred probe using dev_err_probe so the error is handled
and avoid logging lots probe defer information like the following:
[ 9.125121] cw2015 4-0062: Failed to register power supply
[ 9.211131] cw2015 4-0062: Failed to register power supply
Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
drivers/power/supply/cw2015_battery.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c
index d110597746b0..091868e9e9e8 100644
--- a/drivers/power/supply/cw2015_battery.c
+++ b/drivers/power/supply/cw2015_battery.c
@@ -679,7 +679,9 @@ static int cw_bat_probe(struct i2c_client *client)
&cw2015_bat_desc,
&psy_cfg);
if (IS_ERR(cw_bat->rk_bat)) {
- dev_err(cw_bat->dev, "Failed to register power supply\n");
+ /* try again if this happens */
+ dev_err_probe(&client->dev, PTR_ERR(cw_bat->rk_bat),
+ "Failed to register power supply\n");
return PTR_ERR(cw_bat->rk_bat);
}
--
2.31.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe
2021-07-01 22:05 [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe Peter Robinson
@ 2021-07-01 22:14 ` Javier Martinez Canillas
2021-07-16 14:01 ` Sebastian Reichel
0 siblings, 1 reply; 3+ messages in thread
From: Javier Martinez Canillas @ 2021-07-01 22:14 UTC (permalink / raw)
To: Peter Robinson
Cc: Tobias Schrammm, Sebastian Reichel, linux-pm, linux-arm-kernel
On Fri, Jul 2, 2021 at 12:07 AM Peter Robinson <pbrobinson@gmail.com> wrote:
>
> Deal with deferred probe using dev_err_probe so the error is handled
> and avoid logging lots probe defer information like the following:
>
> [ 9.125121] cw2015 4-0062: Failed to register power supply
> [ 9.211131] cw2015 4-0062: Failed to register power supply
>
> Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
> Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> ---
Right, I also found this error message annoying and agree that's too noisy.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Best regards,
Javier
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe
2021-07-01 22:14 ` Javier Martinez Canillas
@ 2021-07-16 14:01 ` Sebastian Reichel
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2021-07-16 14:01 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: Peter Robinson, Tobias Schrammm, linux-pm, linux-arm-kernel
[-- Attachment #1.1: Type: text/plain, Size: 904 bytes --]
Hi,
On Fri, Jul 02, 2021 at 12:14:40AM +0200, Javier Martinez Canillas wrote:
> On Fri, Jul 2, 2021 at 12:07 AM Peter Robinson <pbrobinson@gmail.com> wrote:
> >
> > Deal with deferred probe using dev_err_probe so the error is handled
> > and avoid logging lots probe defer information like the following:
> >
> > [ 9.125121] cw2015 4-0062: Failed to register power supply
> > [ 9.211131] cw2015 4-0062: Failed to register power supply
> >
> > Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver")
> > Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
> > ---
>
> Right, I also found this error message annoying and agree that's too noisy.
>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Thanks, queued (but would have been nicer to just return
dev_err_probe() instead of doing another round of PTR_ERR
conversion).
-- Sebastian
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-16 14:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-01 22:05 [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe Peter Robinson
2021-07-01 22:14 ` Javier Martinez Canillas
2021-07-16 14:01 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox