aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/phy/phy-core.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index 04fc84f2b289..3791838f4bd4 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -225,6 +225,7 @@ int phy_init(struct phy *phy)
225 ret = phy_pm_runtime_get_sync(phy); 225 ret = phy_pm_runtime_get_sync(phy);
226 if (ret < 0 && ret != -ENOTSUPP) 226 if (ret < 0 && ret != -ENOTSUPP)
227 return ret; 227 return ret;
228 ret = 0; /* Override possible ret == -ENOTSUPP */
228 229
229 mutex_lock(&phy->mutex); 230 mutex_lock(&phy->mutex);
230 if (phy->init_count == 0 && phy->ops->init) { 231 if (phy->init_count == 0 && phy->ops->init) {
@@ -233,8 +234,6 @@ int phy_init(struct phy *phy)
233 dev_err(&phy->dev, "phy init failed --> %d\n", ret); 234 dev_err(&phy->dev, "phy init failed --> %d\n", ret);
234 goto out; 235 goto out;
235 } 236 }
236 } else {
237 ret = 0; /* Override possible ret == -ENOTSUPP */
238 } 237 }
239 ++phy->init_count; 238 ++phy->init_count;
240 239
@@ -255,6 +254,7 @@ int phy_exit(struct phy *phy)
255 ret = phy_pm_runtime_get_sync(phy); 254 ret = phy_pm_runtime_get_sync(phy);
256 if (ret < 0 && ret != -ENOTSUPP) 255 if (ret < 0 && ret != -ENOTSUPP)
257 return ret; 256 return ret;
257 ret = 0; /* Override possible ret == -ENOTSUPP */
258 258
259 mutex_lock(&phy->mutex); 259 mutex_lock(&phy->mutex);
260 if (phy->init_count == 1 && phy->ops->exit) { 260 if (phy->init_count == 1 && phy->ops->exit) {
@@ -289,6 +289,7 @@ int phy_power_on(struct phy *phy)
289 ret = phy_pm_runtime_get_sync(phy); 289 ret = phy_pm_runtime_get_sync(phy);
290 if (ret < 0 && ret != -ENOTSUPP) 290 if (ret < 0 && ret != -ENOTSUPP)
291 return ret; 291 return ret;
292 ret = 0; /* Override possible ret == -ENOTSUPP */
292 293
293 mutex_lock(&phy->mutex); 294 mutex_lock(&phy->mutex);
294 if (phy->power_count == 0 && phy->ops->power_on) { 295 if (phy->power_count == 0 && phy->ops->power_on) {
@@ -297,8 +298,6 @@ int phy_power_on(struct phy *phy)
297 dev_err(&phy->dev, "phy poweron failed --> %d\n", ret); 298 dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
298 goto out; 299 goto out;
299 } 300 }
300 } else {
301 ret = 0; /* Override possible ret == -ENOTSUPP */
302 } 301 }
303 ++phy->power_count; 302 ++phy->power_count;
304 mutex_unlock(&phy->mutex); 303 mutex_unlock(&phy->mutex);