diff mbox series

power/supply: ingenic-battery: Don't print error on -EPROBE_DEFER

Message ID 20200221005812.271187-1-paul@crapouillou.net (mailing list archive)
State Not Applicable, archived
Headers show
Series power/supply: ingenic-battery: Don't print error on -EPROBE_DEFER | expand

Commit Message

Paul Cercueil Feb. 21, 2020, 12:58 a.m. UTC
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>
---
 drivers/power/supply/ingenic-battery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Artur Rojek Feb. 27, 2020, 9 p.m. UTC | #1
On 2020-02-21 01:58, Paul Cercueil wrote:
> Don't print an error message if devm_power_supply_register() returns
> -EPROBE_DEFER, since the driver will simply re-probe later.
Hi Paul.

This looks alright.

Acked-by: Artur Rojek <contact@artur-rojek.eu>
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  drivers/power/supply/ingenic-battery.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/ingenic-battery.c
> b/drivers/power/supply/ingenic-battery.c
> index 2748715c4c75..dd3d93dfe3eb 100644
> --- a/drivers/power/supply/ingenic-battery.c
> +++ b/drivers/power/supply/ingenic-battery.c
> @@ -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);
>  	}
diff mbox series

Patch

diff --git a/drivers/power/supply/ingenic-battery.c b/drivers/power/supply/ingenic-battery.c
index 2748715c4c75..dd3d93dfe3eb 100644
--- a/drivers/power/supply/ingenic-battery.c
+++ b/drivers/power/supply/ingenic-battery.c
@@ -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);
 	}