Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 97ac0e47 authored by Russell King's avatar Russell King Committed by Sean Paul
Browse files

drm: convert DT component matching to component_match_add_release()



Convert DT component matching to use component_match_add_release().

Acked-by: default avatarJyri Sarha <jsarha@ti.com>
Reviewed-by: default avatarJyri Sarha <jsarha@ti.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/E1bwo6l-0005Io-Q1@rmk-PC.armlinux.org.uk
parent f54d1867
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -453,7 +453,8 @@ static int hdlcd_probe(struct platform_device *pdev)
		return -EAGAIN;
	}

	component_match_add(&pdev->dev, &match, compare_dev, port);
	drm_of_component_match_add(&pdev->dev, &match, compare_dev, port);
	of_node_put(port);

	return component_master_add_with_match(&pdev->dev, &hdlcd_master_ops,
					       match);
+3 −1
Original line number Diff line number Diff line
@@ -493,7 +493,9 @@ static int malidp_platform_probe(struct platform_device *pdev)
		return -EAGAIN;
	}

	component_match_add(&pdev->dev, &match, malidp_compare_dev, port);
	drm_of_component_match_add(&pdev->dev, &match, malidp_compare_dev,
				   port);
	of_node_put(port);
	return component_master_add_with_match(&pdev->dev, &malidp_master_ops,
					       match);
}
+1 −1
Original line number Diff line number Diff line
@@ -254,7 +254,7 @@ static void armada_add_endpoints(struct device *dev,
			continue;
		}

		component_match_add(dev, match, compare_of, remote);
		drm_of_component_match_add(dev, match, compare_of, remote);
		of_node_put(remote);
	}
}
+26 −2
Original line number Diff line number Diff line
@@ -6,6 +6,11 @@
#include <drm/drm_crtc.h>
#include <drm/drm_of.h>

static void drm_release_of(struct device *dev, void *data)
{
	of_node_put(data);
}

/**
 * drm_crtc_port_mask - find the mask of a registered CRTC by port OF node
 * @dev: DRM device
@@ -63,6 +68,24 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_of_find_possible_crtcs);

/**
 * drm_of_component_match_add - Add a component helper OF node match rule
 * @master: master device
 * @matchptr: component match pointer
 * @compare: compare function used for matching component
 * @node: of_node
 */
void drm_of_component_match_add(struct device *master,
				struct component_match **matchptr,
				int (*compare)(struct device *, void *),
				struct device_node *node)
{
	of_node_get(node);
	component_match_add_release(master, matchptr, drm_release_of,
				    compare, node);
}
EXPORT_SYMBOL_GPL(drm_of_component_match_add);

/**
 * drm_of_component_probe - Generic probe function for a component based master
 * @dev: master device containing the OF node
@@ -101,7 +124,7 @@ int drm_of_component_probe(struct device *dev,
			continue;
		}

		component_match_add(dev, &match, compare_of, port);
		drm_of_component_match_add(dev, &match, compare_of, port);
		of_node_put(port);
	}

@@ -140,7 +163,8 @@ int drm_of_component_probe(struct device *dev,
				continue;
			}

			component_match_add(dev, &match, compare_of, remote);
			drm_of_component_match_add(dev, &match, compare_of,
						   remote);
			of_node_put(remote);
		}
		of_node_put(port);
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <linux/component.h>
#include <linux/of_platform.h>
#include <drm/drm_of.h>

#include "etnaviv_drv.h"
#include "etnaviv_gpu.h"
@@ -629,8 +630,8 @@ static int etnaviv_pdev_probe(struct platform_device *pdev)
			if (!core_node)
				break;

			component_match_add(&pdev->dev, &match, compare_of,
					    core_node);
			drm_of_component_match_add(&pdev->dev, &match,
						   compare_of, core_node);
			of_node_put(core_node);
		}
	} else if (dev->platform_data) {
Loading