mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 22:52:19 +02:00
drm/bridge: analogix_dp: Remove CONFIG_PM related check in analogix_dp_bind()/analogix_dp_unbind()
Remove the check related to CONFIG_PM in order to make the code more concise, as the CONFIG_PM should be a required option for many drivers. In addition, it is preferable to use devm_pm_runtime_enable() instead of manually invoking pm_runtime_enable() followed by pm_runtime_disable(). Suggested-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Damon Ding <damon.ding@rock-chips.com> Link: https://lore.kernel.org/r/20250310104114.2608063-3-damon.ding@rock-chips.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
This commit is contained in:
parent
efab13e7d1
commit
c71db05114
|
|
@ -1695,15 +1695,11 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
|
|||
dp->drm_dev = drm_dev;
|
||||
dp->encoder = dp->plat_data->encoder;
|
||||
|
||||
if (IS_ENABLED(CONFIG_PM)) {
|
||||
pm_runtime_use_autosuspend(dp->dev);
|
||||
pm_runtime_set_autosuspend_delay(dp->dev, 100);
|
||||
pm_runtime_enable(dp->dev);
|
||||
} else {
|
||||
ret = analogix_dp_resume(dp);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
pm_runtime_use_autosuspend(dp->dev);
|
||||
pm_runtime_set_autosuspend_delay(dp->dev, 100);
|
||||
ret = devm_pm_runtime_enable(dp->dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
dp->aux.name = "DP-AUX";
|
||||
dp->aux.transfer = analogix_dpaux_transfer;
|
||||
|
|
@ -1713,7 +1709,7 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
|
|||
ret = drm_dp_aux_register(&dp->aux);
|
||||
if (ret) {
|
||||
DRM_ERROR("failed to register AUX (%d)\n", ret);
|
||||
goto err_disable_pm_runtime;
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = analogix_dp_create_bridge(drm_dev, dp);
|
||||
|
|
@ -1726,13 +1722,6 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
|
|||
|
||||
err_unregister_aux:
|
||||
drm_dp_aux_unregister(&dp->aux);
|
||||
err_disable_pm_runtime:
|
||||
if (IS_ENABLED(CONFIG_PM)) {
|
||||
pm_runtime_dont_use_autosuspend(dp->dev);
|
||||
pm_runtime_disable(dp->dev);
|
||||
} else {
|
||||
analogix_dp_suspend(dp);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -1749,13 +1738,6 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)
|
|||
}
|
||||
|
||||
drm_dp_aux_unregister(&dp->aux);
|
||||
|
||||
if (IS_ENABLED(CONFIG_PM)) {
|
||||
pm_runtime_dont_use_autosuspend(dp->dev);
|
||||
pm_runtime_disable(dp->dev);
|
||||
} else {
|
||||
analogix_dp_suspend(dp);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(analogix_dp_unbind);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user