[From nobody Thu Jun 25 05:55:52 2020
Received: from challenger4.mydhp.de ([185.84.81.4])
 by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux))
 id 1jTXf6-0004A1-Fg
 for openwrt-devel@lists.openwrt.org; Tue, 28 Apr 2020 21:21:06 +0000
From: Johann Neuhauser &lt;johann@it-neuhauser.de&gt;
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=it-neuhauser.de;
 s=atlas188; t=1588108842;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding;
 bh=HsYccrqsn1H+CmluRZoY15DV0j3lMxS6gcazbyBVqOQ=;
 b=JJ3vjTJXL0QAVQ2ernoEQNvBt+WLw2p0Dn4HU0uydh5fKzIwErgfm5IfBMkQzHPMgSGA1v
 qB8BZ8lMmq6hXFUDSzekVJdQjPPCvnI5UrYev+G4gX3uru383kMR/G/vxOF4RJTOvNzef3
 JoxFV0JDcETarPtiHrE1yCcFTsw70LY=
To: openwrt-devel@lists.openwrt.org
Cc: Johann Neuhauser &lt;johann@it-neuhauser.de&gt;,
 Lech Perczak &lt;lech.perczak@gmail.com&gt;
Subject: [PATCH] ath79: phy-ar7200-usb: do not print error on defered init
Date: Tue, 28 Apr 2020 23:20:13 +0200
Message-Id: &lt;20200428212013.18011-1-johann@it-neuhauser.de&gt;
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
X-CRM114-CacheID: sfid-20200428_142104_702495_2268F535 
X-CRM114-Status: UNSURE (   7.24  )
X-CRM114-Notice: Please train this message.
X-Spam-Score: -0.2 (/)
X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary:
 Content analysis details:   (-0.2 points)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from
 envelope-from domain
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
 author's domain
 0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
 valid
 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature

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 &lt;lech.perczak@gmail.com&gt;
Signed-off-by: Johann Neuhauser &lt;johann@it-neuhauser.de&gt;
---
 .../ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch     | 5 +++--
 .../ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch      | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/target/linux/ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch
index fa3487d392..3629e6e875 100644
--- a/target/linux/ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch
+++ b/target/linux/ath79/patches-4.19/0004-phy-add-ath79-usb-phys.patch
@@ -194,7 +194,7 @@ Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
 +MODULE_LICENSE(&quot;GPL&quot;);
 --- /dev/null
 +++ b/drivers/phy/phy-ar7200-usb.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,136 @@
 +/*
 + * Copyright (C) 2015 Alban Bedel &lt;albeu@free.fr&gt;
 + *
@@ -265,7 +265,8 @@ Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
 +
 +	priv-&gt;rst_phy = devm_reset_control_get(&amp;pdev-&gt;dev, &quot;usb-phy&quot;);
 +	if (IS_ERR(priv-&gt;rst_phy)) {
-+		dev_err(&amp;pdev-&gt;dev, &quot;phy reset is missing\n&quot;);
++		if (PTR_ERR(priv-&gt;rst_phy) != -EPROBE_DEFER)
++			dev_err(&amp;pdev-&gt;dev, &quot;phy reset is missing\n&quot;);
 +		return PTR_ERR(priv-&gt;rst_phy);
 +	}
 +
diff --git a/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch
index 7956edb937..e319f738a5 100644
--- a/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch
+++ b/target/linux/ath79/patches-5.4/0004-phy-add-ath79-usb-phys.patch
@@ -194,7 +194,7 @@ Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
 +MODULE_LICENSE(&quot;GPL&quot;);
 --- /dev/null
 +++ b/drivers/phy/phy-ar7200-usb.c
-@@ -0,0 +1,135 @@
+@@ -0,0 +1,136 @@
 +/*
 + * Copyright (C) 2015 Alban Bedel &lt;albeu@free.fr&gt;
 + *
@@ -265,7 +265,8 @@ Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
 +
 +	priv-&gt;rst_phy = devm_reset_control_get(&amp;pdev-&gt;dev, &quot;usb-phy&quot;);
 +	if (IS_ERR(priv-&gt;rst_phy)) {
-+		dev_err(&amp;pdev-&gt;dev, &quot;phy reset is missing\n&quot;);
++		if (PTR_ERR(priv-&gt;rst_phy) != -EPROBE_DEFER)
++			dev_err(&amp;pdev-&gt;dev, &quot;phy reset is missing\n&quot;);
 +		return PTR_ERR(priv-&gt;rst_phy);
 +	}
 +
-- 
2.20.1


]