summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2021-07-02 01:05:16 +0300
committerSebastian Reichel <sre@kernel.org>2021-07-16 17:00:35 +0300
commitad1abe476995d97bfe7546ea91bb4f3dcdfbf3ab (patch)
tree612f8212dd9592ebdd02d3cd6a45c9331565f15e /drivers/power
parent56d629af09b9d4db9792257165844287ecce0a98 (diff)
downloadlinux-ad1abe476995d97bfe7546ea91bb4f3dcdfbf3ab.tar.xz
power: supply: cw2015: use dev_err_probe to allow deferred probe
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> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/cw2015_battery.c4
1 files changed, 3 insertions, 1 deletions
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);
}