* [PATCH] drm/panel: abstract of_panel_find()
@ 2025-05-22 10:00 Jani Nikula
2025-05-22 13:01 ` Dmitry Baryshkov
0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2025-05-22 10:00 UTC (permalink / raw)
To: dri-devel; +Cc: Neil Armstrong, Jessica Zhang, 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 <jani.nikula@intel.com>
---
drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index 650de4da0853..fee65dc65979 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -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);
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: abstract of_panel_find()
2025-05-22 10:00 [PATCH] drm/panel: abstract of_panel_find() Jani Nikula
@ 2025-05-22 13:01 ` Dmitry Baryshkov
2025-05-22 17:04 ` Jani Nikula
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Baryshkov @ 2025-05-22 13:01 UTC (permalink / raw)
To: Jani Nikula; +Cc: dri-devel, Neil Armstrong, Jessica Zhang
On Thu, May 22, 2025 at 01:00:36PM +0300, Jani Nikula wrote:
> 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 <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++-------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/panel: abstract of_panel_find()
2025-05-22 13:01 ` Dmitry Baryshkov
@ 2025-05-22 17:04 ` Jani Nikula
0 siblings, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2025-05-22 17:04 UTC (permalink / raw)
To: Dmitry Baryshkov; +Cc: dri-devel, Neil Armstrong, Jessica Zhang
On Thu, 22 May 2025, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote:
> On Thu, May 22, 2025 at 01:00:36PM +0300, Jani Nikula wrote:
>> 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 <jani.nikula@intel.com>
>> ---
>> drivers/gpu/drm/drm_panel.c | 23 ++++++++++++++++-------
>> 1 file changed, 16 insertions(+), 7 deletions(-)
>>
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Thanks, pushed to drm-misc-next.
BR,
Jani.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-22 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 10:00 [PATCH] drm/panel: abstract of_panel_find() Jani Nikula
2025-05-22 13:01 ` Dmitry Baryshkov
2025-05-22 17:04 ` Jani Nikula
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.