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]
Date:	Wed,  2 Apr 2014 15:25:43 +0300
From:	Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:	Kishon Vijay Abraham I <kishon@...com>
Cc:	Felipe Balbi <balbi@...com>, chiau.ee.chew@...el.com,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] phy: don't return error from the stubs

Returning 0 from the stubs for the functions that are used
for PHY controlling. The interface should not appear to be
failing with every operation when the framework is not
enabled.

This fixes an issue in dwc3 driver, where the driver fails
the moment first phy_*() call is made when the framework is
not enabled.

Reported-by: Chew, Chiau Ee <chiau.ee.chew@...el.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
---
 include/linux/phy/phy.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index e2f5ca9..00d6949 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -174,22 +174,22 @@ void devm_of_phy_provider_unregister(struct device *dev,
 #else
 static inline int phy_pm_runtime_get(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_pm_runtime_get_sync(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_pm_runtime_put(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_pm_runtime_put_sync(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline void phy_pm_runtime_allow(struct phy *phy)
@@ -204,27 +204,27 @@ static inline void phy_pm_runtime_forbid(struct phy *phy)
 
 static inline int phy_init(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_exit(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_power_on(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_power_off(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline int phy_get_bus_width(struct phy *phy)
 {
-	return -ENOSYS;
+	return 0;
 }
 
 static inline void phy_set_bus_width(struct phy *phy, int bus_width)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ