power/supply: ingenic-battery: Don't print error on -EPROBE_DEFER
authorPaul Cercueil <paul@crapouillou.net>
Fri, 21 Feb 2020 00:58:12 +0000 (21:58 -0300)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Mon, 24 Feb 2020 17:04:43 +0000 (18:04 +0100)
Don't print an error message if devm_power_supply_register() returns
-EPROBE_DEFER, since the driver will simply re-probe later.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ingenic-battery.c

index 2748715..dd3d93d 100644 (file)
@@ -148,7 +148,8 @@ static int ingenic_battery_probe(struct platform_device *pdev)
 
        bat->battery = devm_power_supply_register(dev, desc, &psy_cfg);
        if (IS_ERR(bat->battery)) {
-               dev_err(dev, "Unable to register battery\n");
+               if (PTR_ERR(bat->battery) != -EPROBE_DEFER)
+                       dev_err(dev, "Unable to register battery\n");
                return PTR_ERR(bat->battery);
        }