Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Krzysztof Kozlowski and committed by
Sebastian Reichel
ec744270 4024810c

+2 -5
+2 -5
drivers/power/supply/cpcap-battery.c
··· 747 747 return 0; 748 748 749 749 out_err: 750 - if (error != -EPROBE_DEFER) 751 - dev_err(ddata->dev, "could not initialize VBUS or ID IIO: %i\n", 752 - error); 753 - 754 - return error; 750 + return dev_err_probe(ddata->dev, error, 751 + "could not initialize VBUS or ID IIO\n"); 755 752 } 756 753 757 754 /* Calibrate coulomb counter */