diff mbox series

[6/7] power: supply: cpcap-battery: Fix pointless EPROBE_DEFER warnings

Message ID 20190407181254.64537-7-tony@atomide.com (mailing list archive)
State New, archived
Headers show
Series Some fixes and improvments for cpcap battery and charger | expand

Commit Message

Tony Lindgren April 7, 2019, 6:12 p.m. UTC
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.

Cc: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/power/supply/cpcap-battery.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Pavel Machek April 8, 2019, 12:04 p.m. UTC | #1
On Sun 2019-04-07 11:12:53, Tony Lindgren wrote:
> 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>

6,7: Acked-by: Pavel Machek <pavel@ucw.cz>
diff mbox series

Patch

diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
--- 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;
 }