[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211202222732.2453851-23-swboyd@chromium.org>
Date: Thu, 2 Dec 2021 14:27:20 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
dri-devel@...ts.freedesktop.org, freedreno@...ts.freedesktop.org,
Daniel Vetter <daniel.vetter@...ll.ch>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Rob Clark <robdclark@...il.com>,
Russell King <rmk+kernel@....linux.org.uk>,
Saravana Kannan <saravanak@...gle.com>
Subject: [PATCH v4 22/34] drm/sti: Migrate to aggregate driver
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: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Rob Clark <robdclark@...il.com>
Cc: Russell King <rmk+kernel@....linux.org.uk>
Cc: Saravana Kannan <saravanak@...gle.com>
Signed-off-by: Stephen Boyd <swboyd@...omium.org>
---
drivers/gpu/drm/sti/sti_drv.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index c7efb43b83ee..b277cc679154 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -182,8 +182,9 @@ static void sti_cleanup(struct drm_device *ddev)
ddev->dev_private = NULL;
}
-static int sti_bind(struct device *dev)
+static int sti_bind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *ddev;
int ret;
@@ -216,8 +217,9 @@ static int sti_bind(struct device *dev)
return ret;
}
-static void sti_unbind(struct device *dev)
+static void sti_unbind(struct aggregate_device *adev)
{
+ struct device *dev = adev->parent;
struct drm_device *ddev = dev_get_drvdata(dev);
drm_dev_unregister(ddev);
@@ -225,9 +227,13 @@ static void sti_unbind(struct device *dev)
drm_dev_put(ddev);
}
-static const struct component_master_ops sti_ops = {
- .bind = sti_bind,
- .unbind = sti_unbind,
+static struct aggregate_driver sti_aggregate_driver = {
+ .probe = sti_bind,
+ .remove = sti_unbind,
+ .driver = {
+ .name = "sti_drm",
+ .owner = THIS_MODULE,
+ },
};
static int sti_platform_probe(struct platform_device *pdev)
@@ -249,12 +255,12 @@ static int sti_platform_probe(struct platform_device *pdev)
child_np = of_get_next_available_child(node, child_np);
}
- return component_master_add_with_match(dev, &sti_ops, match);
+ return component_aggregate_register(dev, &sti_aggregate_driver, match);
}
static int sti_platform_remove(struct platform_device *pdev)
{
- component_master_del(&pdev->dev, &sti_ops);
+ component_aggregate_unregister(&pdev->dev, &sti_aggregate_driver);
return 0;
}
--
https://chromeos.dev
Powered by blists - more mailing lists