lkml.org 
[lkml]   [2021]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 08/34] drm/arm/hdlcd: Migrate to aggregate driver
Date
Use an aggregate driver instead of component ops so that we can get
proper driver probe ordering of the aggregate device with respect to all
the component devices that make up the aggregate device.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Saravana Kannan <saravanak@google.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
drivers/gpu/drm/arm/hdlcd_drv.c | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 479c2422a2e0..8f3e5924042a 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -270,8 +270,9 @@ static const struct drm_driver hdlcd_driver = {
.minor = 0,
};

-static int hdlcd_drm_bind(struct device *dev)
+static int hdlcd_drm_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm;
struct hdlcd_drm_private *hdlcd;
int ret;
@@ -344,8 +345,9 @@ static int hdlcd_drm_bind(struct device *dev)
return ret;
}

-static void hdlcd_drm_unbind(struct device *dev)
+static void hdlcd_drm_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *drm = dev_get_drvdata(dev);
struct hdlcd_drm_private *hdlcd = drm->dev_private;

@@ -367,9 +369,13 @@ static void hdlcd_drm_unbind(struct device *dev)
drm_dev_put(drm);
}

-static const struct component_master_ops hdlcd_master_ops = {
- .bind = hdlcd_drm_bind,
- .unbind = hdlcd_drm_unbind,
+static struct aggregate_driver hdlcd_aggregate_driver = {
+ .probe = hdlcd_drm_bind,
+ .remove = hdlcd_drm_unbind,
+ .driver = {
+ .name = "hdlcd_drm",
+ .owner = THIS_MODULE,
+ },
};

static int compare_dev(struct device *dev, void *data)
@@ -390,13 +396,12 @@ static int hdlcd_probe(struct platform_device *pdev)
drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
of_node_put(port);

- return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops,
- match);
+ return component_aggregate_register(&pdev->dev, &hdlcd_aggregate_driver, match);
}

static int hdlcd_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &hdlcd_master_ops);
+ component_aggregate_unregister(&pdev->dev, &hdlcd_aggregate_driver);
return 0;
}

--
https://chromeos.dev
\
 
 \ /
  Last update: 2021-10-06 21:39    [W:0.263 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site