diff options
author | Grygorii Strashko <grygorii.strashko@ti.com> | 2014-04-18 23:21:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-24 15:53:38 -0400 |
commit | 2b97789fa289d531e767d994a77e34ec58f328c4 (patch) | |
tree | 86fed1906885de4609b7b0c7cbbcf45c1cf1816d | |
parent | 743bb387a1edbf1ebbba6cf77c1af3e488886c39 (diff) |
phy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY
This fixes a regression on Keystone 2 platforms caused by patch
57303488cd37da58263e842de134dc65f7c626d5
"usb: dwc3: adapt dwc3 core to use Generic PHY Framework" which adds
optional support of generic phy in DWC3 core.
On Keystone 2 platforms the USB is not working now because
CONFIG_GENERIC_PHY isn't set and, as result, Generic PHY APIs stubs
return -ENOSYS always. The log shows:
dwc3 2690000.dwc3: failed to initialize core
dwc3: probe of 2690000.dwc3 failed with error -38
Hence, fix it by making NULL a valid phy reference in Generic PHY
APIs stubs in the same way as it was done by the patch
04c2facad8fee66c981a51852806d8923336f362 "drivers: phy: Make NULL
a valid phy reference".
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | include/linux/phy/phy.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e2f5ca96cddc..2760744cb2a7 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h | |||
@@ -174,21 +174,29 @@ void devm_of_phy_provider_unregister(struct device *dev, | |||
174 | #else | 174 | #else |
175 | static inline int phy_pm_runtime_get(struct phy *phy) | 175 | static inline int phy_pm_runtime_get(struct phy *phy) |
176 | { | 176 | { |
177 | if (!phy) | ||
178 | return 0; | ||
177 | return -ENOSYS; | 179 | return -ENOSYS; |
178 | } | 180 | } |
179 | 181 | ||
180 | static inline int phy_pm_runtime_get_sync(struct phy *phy) | 182 | static inline int phy_pm_runtime_get_sync(struct phy *phy) |
181 | { | 183 | { |
184 | if (!phy) | ||
185 | return 0; | ||
182 | return -ENOSYS; | 186 | return -ENOSYS; |
183 | } | 187 | } |
184 | 188 | ||
185 | static inline int phy_pm_runtime_put(struct phy *phy) | 189 | static inline int phy_pm_runtime_put(struct phy *phy) |
186 | { | 190 | { |
191 | if (!phy) | ||
192 | return 0; | ||
187 | return -ENOSYS; | 193 | return -ENOSYS; |
188 | } | 194 | } |
189 | 195 | ||
190 | static inline int phy_pm_runtime_put_sync(struct phy *phy) | 196 | static inline int phy_pm_runtime_put_sync(struct phy *phy) |
191 | { | 197 | { |
198 | if (!phy) | ||
199 | return 0; | ||
192 | return -ENOSYS; | 200 | return -ENOSYS; |
193 | } | 201 | } |
194 | 202 | ||
@@ -204,21 +212,29 @@ static inline void phy_pm_runtime_forbid(struct phy *phy) | |||
204 | 212 | ||
205 | static inline int phy_init(struct phy *phy) | 213 | static inline int phy_init(struct phy *phy) |
206 | { | 214 | { |
215 | if (!phy) | ||
216 | return 0; | ||
207 | return -ENOSYS; | 217 | return -ENOSYS; |
208 | } | 218 | } |
209 | 219 | ||
210 | static inline int phy_exit(struct phy *phy) | 220 | static inline int phy_exit(struct phy *phy) |
211 | { | 221 | { |
222 | if (!phy) | ||
223 | return 0; | ||
212 | return -ENOSYS; | 224 | return -ENOSYS; |
213 | } | 225 | } |
214 | 226 | ||
215 | static inline int phy_power_on(struct phy *phy) | 227 | static inline int phy_power_on(struct phy *phy) |
216 | { | 228 | { |
229 | if (!phy) | ||
230 | return 0; | ||
217 | return -ENOSYS; | 231 | return -ENOSYS; |
218 | } | 232 | } |
219 | 233 | ||
220 | static inline int phy_power_off(struct phy *phy) | 234 | static inline int phy_power_off(struct phy *phy) |
221 | { | 235 | { |
236 | if (!phy) | ||
237 | return 0; | ||
222 | return -ENOSYS; | 238 | return -ENOSYS; |
223 | } | 239 | } |
224 | 240 | ||