summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/cpcap-battery.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <krzk@kernel.org>2020-08-26 16:48:55 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2020-08-26 17:25:42 +0200
commitec744270c92785772b111ba21a6bb23a8cc2cb4d (patch)
tree0771ec19920612ce5d74a7e6e5f680aa2608ec19 /drivers/power/supply/cpcap-battery.c
parent4024810c5aad6b63a7e4de26850ea0c8ea870850 (diff)
downloadlinux-ec744270c92785772b111ba21a6bb23a8cc2cb4d.tar.bz2
power: supply: cpcap: Simplify with dev_err_probe()
Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/cpcap-battery.c')
-rw-r--r--drivers/power/supply/cpcap-battery.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
index 90eba364664b..295611b3b15e 100644
--- a/drivers/power/supply/cpcap-battery.c
+++ b/drivers/power/supply/cpcap-battery.c
@@ -747,11 +747,8 @@ static int cpcap_battery_init_iio(struct cpcap_battery_ddata *ddata)
return 0;
out_err:
- if (error != -EPROBE_DEFER)
- dev_err(ddata->dev, "could not initialize VBUS or ID IIO: %i\n",
- error);
-
- return error;
+ return dev_err_probe(ddata->dev, error,
+ "could not initialize VBUS or ID IIO\n");
}
/* Calibrate coulomb counter */