ath79: phy-ar7200-usb: do not print error on defered init
authorJohann Neuhauser <johann@it-neuhauser.de>
Tue, 28 Apr 2020 21:20:13 +0000 (23:20 +0200)
committerPetr Štetiar <ynezz@true.cz>
Wed, 3 Jun 2020 14:49:28 +0000 (16:49 +0200)
This is only a cosmetic correction, as the driver works as expected.
However, the error message confuses users about a missing reset definition.

On a defered init we don't see the following error message now:
[    0.078292] ar7200-usb-phy usb-phy: phy reset is missing

Tested-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
target/linux/ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch
target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch

index fa3487d392e95f4ab5632eadad8ba7301f88bd4b..3629e6e87505f168dcf07ecbb1520aa53ca50e17 100644 (file)
@@ -194,7 +194,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
 +MODULE_LICENSE("GPL");
 --- /dev/null
 +++ b/drivers/phy/phy-ar7200-usb.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,136 @@
 +/*
 + * Copyright (C) 2015 Alban Bedel <albeu@free.fr>
 + *
@@ -265,7 +265,8 @@ Signed-off-by: John Crispin <john@phrozen.org>
 +
 +      priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy");
 +      if (IS_ERR(priv->rst_phy)) {
-+              dev_err(&pdev->dev, "phy reset is missing\n");
++              if (PTR_ERR(priv->rst_phy) != -EPROBE_DEFER)
++                      dev_err(&pdev->dev, "phy reset is missing\n");
 +              return PTR_ERR(priv->rst_phy);
 +      }
 +
index 7956edb937a5f97d2d176b3e67aa7859f046d43d..e319f738a5a4bc13deb7e2b76bce0ac2f60b8fde 100644 (file)
@@ -194,7 +194,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
 +MODULE_LICENSE("GPL");
 --- /dev/null
 +++ b/drivers/phy/phy-ar7200-usb.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,136 @@
 +/*
 + * Copyright (C) 2015 Alban Bedel <albeu@free.fr>
 + *
@@ -265,7 +265,8 @@ Signed-off-by: John Crispin <john@phrozen.org>
 +
 +      priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy");
 +      if (IS_ERR(priv->rst_phy)) {
-+              dev_err(&pdev->dev, "phy reset is missing\n");
++              if (PTR_ERR(priv->rst_phy) != -EPROBE_DEFER)
++                      dev_err(&pdev->dev, "phy reset is missing\n");
 +              return PTR_ERR(priv->rst_phy);
 +      }
 +