power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings
authorTony Lindgren <tony@atomide.com>
Sun, 7 Apr 2019 18:12:53 +0000 (11:12 -0700)
committerSebastian Reichel <sre@kernel.org>
Mon, 15 Apr 2019 20:53:50 +0000 (22:53 +0200)
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 <tony@atomide.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cpcap-battery.c

index 2f55a25addee33fed67adae9c131f0be1c707e21..61d6447d1966f4c02fbc89904bf2382c67304b20 100644 (file)
@@ -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;
 }