|
@@ -52,7 +52,9 @@ static void devm_phy_consume(struct device *dev, void *res)
|
|
|
|
|
|
static int devm_phy_match(struct device *dev, void *res, void *match_data)
|
|
static int devm_phy_match(struct device *dev, void *res, void *match_data)
|
|
{
|
|
{
|
|
- return res == match_data;
|
|
|
|
|
|
+ struct phy **phy = res;
|
|
|
|
+
|
|
|
|
+ return *phy == match_data;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -223,6 +225,7 @@ int phy_init(struct phy *phy)
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
return ret;
|
|
return ret;
|
|
|
|
+ ret = 0; /* Override possible ret == -ENOTSUPP */
|
|
|
|
|
|
mutex_lock(&phy->mutex);
|
|
mutex_lock(&phy->mutex);
|
|
if (phy->init_count == 0 && phy->ops->init) {
|
|
if (phy->init_count == 0 && phy->ops->init) {
|
|
@@ -231,8 +234,6 @@ int phy_init(struct phy *phy)
|
|
dev_err(&phy->dev, "phy init failed --> %d\n", ret);
|
|
dev_err(&phy->dev, "phy init failed --> %d\n", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- ret = 0; /* Override possible ret == -ENOTSUPP */
|
|
|
|
}
|
|
}
|
|
++phy->init_count;
|
|
++phy->init_count;
|
|
|
|
|
|
@@ -253,6 +254,7 @@ int phy_exit(struct phy *phy)
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
return ret;
|
|
return ret;
|
|
|
|
+ ret = 0; /* Override possible ret == -ENOTSUPP */
|
|
|
|
|
|
mutex_lock(&phy->mutex);
|
|
mutex_lock(&phy->mutex);
|
|
if (phy->init_count == 1 && phy->ops->exit) {
|
|
if (phy->init_count == 1 && phy->ops->exit) {
|
|
@@ -287,6 +289,7 @@ int phy_power_on(struct phy *phy)
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
ret = phy_pm_runtime_get_sync(phy);
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
if (ret < 0 && ret != -ENOTSUPP)
|
|
return ret;
|
|
return ret;
|
|
|
|
+ ret = 0; /* Override possible ret == -ENOTSUPP */
|
|
|
|
|
|
mutex_lock(&phy->mutex);
|
|
mutex_lock(&phy->mutex);
|
|
if (phy->power_count == 0 && phy->ops->power_on) {
|
|
if (phy->power_count == 0 && phy->ops->power_on) {
|
|
@@ -295,8 +298,6 @@ int phy_power_on(struct phy *phy)
|
|
dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
|
|
dev_err(&phy->dev, "phy poweron failed --> %d\n", ret);
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
- } else {
|
|
|
|
- ret = 0; /* Override possible ret == -ENOTSUPP */
|
|
|
|
}
|
|
}
|
|
++phy->power_count;
|
|
++phy->power_count;
|
|
mutex_unlock(&phy->mutex);
|
|
mutex_unlock(&phy->mutex);
|