summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYong Wu <yong.wu@mediatek.com>2022-02-14 09:07:59 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-25 14:16:12 +0300
commit1434fc3f3904a1d228a4f88822d31a3e746b1d73 (patch)
tree7eedf61013eb679d79174eca9ec7e6a8fe86a039 /drivers
parenta190622af3f9a6ff86554bf7665f022cb919223e (diff)
downloadlinux-1434fc3f3904a1d228a4f88822d31a3e746b1d73.tar.xz
drm/armada: Make use of the helper component_compare_of/dev_name
Use the common compare helpers from component. Cc: Russell King <linux@armlinux.org.uk> Signed-off-by: Yong Wu <yong.wu@mediatek.com> Link: https://lore.kernel.org/r/20220214060819.7334-4-yong.wu@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/armada/armada_drv.c17
1 files 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) {