summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/etnaviv/etnaviv_drv.c
diff options
context:
space:
mode:
authorYong Wu <yong.wu@mediatek.com>2022-02-14 09:08:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-02-25 14:16:12 +0300
commit0a522394202f1f5ce1874b807c60dca3282b4c8c (patch)
treecb93afd68b1602b2e8d8164bd3ecd4f9ffff54a2 /drivers/gpu/drm/etnaviv/etnaviv_drv.c
parent1434fc3f3904a1d228a4f88822d31a3e746b1d73 (diff)
downloadlinux-0a522394202f1f5ce1874b807c60dca3282b4c8c.tar.xz
drm/etnaviv: Make use of the helper component_compare_of/dev_name
Use the common compare helpers from component. Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Russell King <linux+etnaviv@armlinux.org.uk> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: etnaviv@lists.freedesktop.org Signed-off-by: Yong Wu <yong.wu@mediatek.com> Link: https://lore.kernel.org/r/20220214060819.7334-5-yong.wu@mediatek.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/etnaviv/etnaviv_drv.c')
-rw-r--r--drivers/gpu/drm/etnaviv/etnaviv_drv.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 0b756ecb1bc2..1d2b4fb4bcf8 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -574,18 +574,6 @@ static const struct component_master_ops etnaviv_master_ops = {
.unbind = etnaviv_unbind,
};
-static int compare_of(struct device *dev, void *data)
-{
- struct device_node *np = data;
-
- return dev->of_node == np;
-}
-
-static int compare_str(struct device *dev, void *data)
-{
- return !strcmp(dev_name(dev), data);
-}
-
static int etnaviv_pdev_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -603,14 +591,14 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
first_node = core_node;
drm_of_component_match_add(&pdev->dev, &match,
- compare_of, core_node);
+ component_compare_of, core_node);
}
} else {
char **names = dev->platform_data;
unsigned i;
for (i = 0; names[i]; i++)
- component_match_add(dev, &match, compare_str, names[i]);
+ component_match_add(dev, &match, component_compare_dev_name, names[i]);
}
/*