Commit ec744270 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Sebastian Reichel

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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 4024810c
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment