lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <663dfcec9f703c41759dcd4cd824d00caa2dd5fb.1674036031.git.geert+renesas@glider.be>
Date:   Wed, 18 Jan 2023 11:02:12 +0100
From:   Geert Uytterhoeven <geert+renesas@...der.be>
To:     Vinod Koul <vkoul@...nel.org>,
        Kishon Vijay Abraham I <kishon@...nel.org>
Cc:     Maxime Ripard <mripard@...nel.org>, Andrew Lunn <andrew@...n.ch>,
        linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH] phy: Return NULL if the PHY is optional (part two)

If we're trying to get a handle to an optional PHY, then the PHY
framework being disabled shouldn't return a hard error.

Instead, return NULL just like phy_optional_get() does when there's no
PHY provided in the DT.

Based on commit 11a6e41c0ee503ff ("phy: Return NULL if the phy is
optional"), which did the same thing for devm_phy_optional_get().

Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
It seems there were never any in-tree users of this function since its
introduction in 788a4d56ff378bff ("drivers: phy: Add support for
optional phys") in v3.14.
Perhaps it should be removed?
---
 include/linux/phy/phy.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index b1413757fcc3b89b..559c3da515073697 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -429,7 +429,7 @@ static inline struct phy *phy_get(struct device *dev, const char *string)
 static inline struct phy *phy_optional_get(struct device *dev,
 					   const char *string)
 {
-	return ERR_PTR(-ENOSYS);
+	return NULL;
 }
 
 static inline struct phy *devm_phy_get(struct device *dev, const char *string)
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ