We match of_node while searching for a device. Make this
more generic in preparation for the ACPI support by using
fwnode_handle.
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-#ifdef CONFIG_OF
-static int of_dev_node_match(struct device *dev, void *data)
+static int coresight_device_fwnode_match(struct device *dev, void *fwnode)
- return dev->of_node == data;
+ return dev_fwnode(dev) == fwnode;
-of_coresight_get_endpoint_device(struct device_node *endpoint)
+coresight_find_device_by_fwnode(struct fwnode_handle *fwnode)
{
struct device *dev = NULL;
{
struct device *dev = NULL;
* platform bus.
*/
dev = bus_find_device(&platform_bus_type, NULL,
* platform bus.
*/
dev = bus_find_device(&platform_bus_type, NULL,
- endpoint, of_dev_node_match);
+ fwnode, coresight_device_fwnode_match);
* looking for the device that matches the endpoint node.
*/
return bus_find_device(&amba_bustype, NULL,
* looking for the device that matches the endpoint node.
*/
return bus_find_device(&amba_bustype, NULL,
- endpoint, of_dev_node_match);
+ fwnode, coresight_device_fwnode_match);
static inline bool of_coresight_legacy_ep_is_input(struct device_node *ep)
{
return of_property_read_bool(ep, "slave-mode");
static inline bool of_coresight_legacy_ep_is_input(struct device_node *ep)
{
return of_property_read_bool(ep, "slave-mode");
struct device_node *rparent = NULL;
struct device_node *rep = NULL;
struct device *rdev = NULL;
struct device_node *rparent = NULL;
struct device_node *rep = NULL;
struct device *rdev = NULL;
+ struct fwnode_handle *rdev_fwnode;
do {
/* Parse the local port details */
do {
/* Parse the local port details */
if (of_graph_parse_endpoint(rep, &rendpoint))
break;
if (of_graph_parse_endpoint(rep, &rendpoint))
break;
+ rdev_fwnode = of_fwnode_handle(rparent);
/* If the remote device is not available, defer probing */
/* If the remote device is not available, defer probing */
- rdev = of_coresight_get_endpoint_device(rparent);
+ rdev = coresight_find_device_by_fwnode(rdev_fwnode);
if (!rdev) {
ret = -EPROBE_DEFER;
break;
if (!rdev) {
ret = -EPROBE_DEFER;
break;