drm/panel: abstract of_panel_find()
Subsystems (3)
PATCH 1/1 drm/panel: abstract of_panel_find()
Add a helper to wrap OF-specific calls in drm_panel_add_follower() in preparation for adding an ACPI equivalent in the future. No functional changes.
Signed-off-by Jani Nikula <[email protected]>
--- drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
drivers/gpu/drm/drm_panel.c +16 -7
@@ -473,6 +473,21 @@ int of_drm_get_panel_orientation(const struct device_node *np,EXPORT_SYMBOL (of_drm_get_panel_orientation);#endif +static struct drm_panel *of_find_panel (struct device *follower_dev) +{ +struct device_node *panel_np; +struct drm_panel *panel; + + panel_np =of_parse_phandle (follower_dev->of_node,"panel" ,0 ); +if (!panel_np) +return ERR_PTR (-ENODEV ); + + panel =of_drm_find_panel (panel_np); +of_node_put (panel_np); + +return panel; +} +/** * drm_is_panel_follower() - Check if the device is a panel follower * @dev: The 'struct device' to check
@@ -518,16 +533,10 @@ EXPORT_SYMBOL(drm_is_panel_follower);int drm_panel_add_follower (struct device *follower_dev,struct drm_panel_follower *follower) { -struct device_node *panel_np;struct drm_panel *panel;int ret; - panel_np =of_parse_phandle (follower_dev->of_node,"panel" ,0 ); -if (!panel_np) -return -ENODEV ; - - panel =of_drm_find_panel (panel_np); -of_node_put (panel_np); + panel =of_find_panel (follower_dev);if (IS_ERR (panel))return PTR_ERR (panel);
Signature · 1 line
2.39.5
Quoted 9 lines · Jani Nikula
Add a helper to wrap OF-specific calls in
drm_panel_add_follower()in preparation for adding an ACPI equivalent in the future. No functional changes.Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
Reviewed-by Dmitry Baryshkov <[email protected]>
Signature · 2 lines
With best wishes Dmitry
Quoted 5 lines · Dmitry Baryshkov
Quoted 4 lines · Jani Nikula
Add a helper to wrap OF-specific calls in
drm_panel_add_follower()in preparation for adding an ACPI equivalent in the future. No functional changes.
Quoted 7 lines
Quoted 5 lines
Signed-off-by Jani Nikula <[email protected]>--- drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)Reviewed-by Dmitry Baryshkov <[email protected]>
Thanks, pushed to drm-misc-next.
BR,
Jani.
Signature · 1 line
Jani Nikula, Intel