[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220214060819.7334-4-yong.wu@mediatek.com>
Date: Mon, 14 Feb 2022 14:07:59 +0800
From: Yong Wu <yong.wu@...iatek.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
<dri-devel@...ts.freedesktop.org>
CC: James Wang <james.qian.wang@....com>,
Liviu Dudau <liviu.dudau@....com>,
<iommu@...ts.linux-foundation.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
<linux-kernel@...r.kernel.org>, "Joerg Roedel" <joro@...tes.org>,
Will Deacon <will@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
<linux-mediatek@...ts.infradead.org>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
<linux-arm-kernel@...ts.infradead.org>,
"Stephen Boyd" <sboyd@...nel.org>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Hsin-Yi Wang <hsinyi@...omium.org>,
Robin Murphy <robin.murphy@....com>,
Tomasz Figa <tfiga@...omium.org>,
<srv_heupstream@...iatek.com>, Rob Clark <robdclark@...il.com>,
Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
Sebastian Reichel <sre@...nel.org>,
Yong Wu <yong.wu@...iatek.com>,
"Russell King" <linux@...linux.org.uk>
Subject: [PATCH 03/23] drm/armada: Make use of the helper component_compare_of/dev_name
Use the common compare helpers from component.
Cc: Russell King <linux@...linux.org.uk>
Signed-off-by: Yong Wu <yong.wu@...iatek.com>
---
drivers/gpu/drm/armada/armada_drv.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 8e3e98f13db4..224607a6ae16 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -177,17 +177,6 @@ static void armada_drm_unbind(struct device *dev)
drm_mm_takedown(&priv->linear);
}
-static int compare_of(struct device *dev, void *data)
-{
- return dev->of_node == data;
-}
-
-static int compare_dev_name(struct device *dev, void *data)
-{
- const char *name = data;
- return !strcmp(dev_name(dev), name);
-}
-
static void armada_add_endpoints(struct device *dev,
struct component_match **match, struct device_node *dev_node)
{
@@ -196,7 +185,7 @@ static void armada_add_endpoints(struct device *dev,
for_each_endpoint_of_node(dev_node, ep) {
remote = of_graph_get_remote_port_parent(ep);
if (remote && of_device_is_available(remote))
- drm_of_component_match_add(dev, match, compare_of,
+ drm_of_component_match_add(dev, match, component_compare_of,
remote);
of_node_put(remote);
}
@@ -213,7 +202,7 @@ static int armada_drm_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
int ret;
- ret = drm_of_component_probe(dev, compare_dev_name, &armada_master_ops);
+ ret = drm_of_component_probe(dev, component_compare_dev_name, &armada_master_ops);
if (ret != -EINVAL)
return ret;
@@ -223,7 +212,7 @@ static int armada_drm_probe(struct platform_device *pdev)
int i;
for (i = 0; devices[i]; i++)
- component_match_add(dev, &match, compare_dev_name,
+ component_match_add(dev, &match, component_compare_dev_name,
devices[i]);
if (i == 0) {
--
2.18.0
Powered by blists - more mailing lists