[PATCH v2 4/4] media: v4l2-async: Don't check fwnode name to detect endpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use the presence of a "remote-endpoint" property to detect if a fwnode
is an endpoint node, as checking the node name won't work on ACPI-based
implementations.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
---
 drivers/media/v4l2-core/v4l2-async.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/v4l2-core/v4l2-async.c b/drivers/media/v4l2-core/v4l2-async.c
index 9f393a7be455..a5f83ba502df 100644
--- a/drivers/media/v4l2-core/v4l2-async.c
+++ b/drivers/media/v4l2-core/v4l2-async.c
@@ -78,7 +78,6 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier,
 	bool asd_fwnode_is_ep;
 	bool sd_fwnode_is_ep;
 	struct device *dev;
-	const char *name;
 
 	/*
 	 * Both the subdev and the async subdev can provide either an endpoint
@@ -92,10 +91,10 @@ static bool match_fwnode(struct v4l2_async_notifier *notifier,
 	 * Otherwise, check if the sd fwnode and the asd fwnode refer to an
 	 * endpoint or a device. If they're of the same type, there's no match.
 	 */
-	name = fwnode_get_name(sd->fwnode);
-	sd_fwnode_is_ep = name && strstarts(name, "endpoint");
-	name = fwnode_get_name(asd->match.fwnode);
-	asd_fwnode_is_ep = name && strstarts(name, "endpoint");
+	sd_fwnode_is_ep = fwnode_property_present(sd->fwnode,
+						  "remote-endpoint");
+	asd_fwnode_is_ep = fwnode_property_present(asd->match.fwnode,
+						   "remote-endpoint");
 
 	if (sd_fwnode_is_ep == asd_fwnode_is_ep)
 		return false;
-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux