Commit 1434fc3f authored by Yong Wu's avatar Yong Wu Committed by Greg Kroah-Hartman
Browse files

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: default avatarYong Wu <yong.wu@mediatek.com>
Link: https://lore.kernel.org/r/20220214060819.7334-4-yong.wu@mediatek.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a190622a
Loading
Loading
Loading
Loading
+3 −14
Original line number Diff line number Diff line
@@ -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) {