From: Tony Lindgren Date: Sun, 7 Apr 2019 18:12:53 +0000 (-0700) Subject: power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings X-Git-Tag: v5.2-rc1~50^2~24 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ffaf6f6773af7d2bad983f43f6ffb4246591a578;p=linux.git power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings With loadable modules we may get the following during init: could not initialize VBUS or ID IIO: -517 Let's not print any pointless error messages for deferred probe. Signed-off-by: Tony Lindgren Acked-by: Pavel Machek Signed-off-by: Sebastian Reichel --- diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c index 2f55a25addee..61d6447d1966 100644 --- a/drivers/power/supply/cpcap-battery.c +++ b/drivers/power/supply/cpcap-battery.c @@ -669,8 +669,9 @@ static int cpcap_battery_init_iio(struct cpcap_battery_ddata *ddata) return 0; out_err: - dev_err(ddata->dev, "could not initialize VBUS or ID IIO: %i\n", - error); + if (error != -EPROBE_DEFER) + dev_err(ddata->dev, "could not initialize VBUS or ID IIO: %i\n", + error); return error; }