Skip to contentSkip to conversation

usb: typec: Replace custom implementation of device_match_fwnode()

PATCH In review Andy Shevchenko 2 participants 2 messages Sep 27, 2022 – Sep 28, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: typec: Replace custom implementation of device_match_fwnode()

Replace custom implementation of the device_match_fwnode().

---
 drivers/usb/typec/mux.c     | 4 ++--
 drivers/usb/typec/retimer.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/typec/mux.c +2 -2
index f81ea26ab389..c7177ddd4f12 100644
@@ -29,7 +29,7 @@ static int switch_fwnode_match(struct device *dev, const void *fwnode)
 	if (!is_typec_switch_dev(dev))
 		return 0;
 
-	return dev_fwnode(dev) == fwnode;
+	return device_match_fwnode(dev, fwnode);
 }
 
 static void *typec_switch_match(const struct fwnode_handle *fwnode,
@@ -259,7 +259,7 @@ static int mux_fwnode_match(struct device *dev, const void *fwnode)
 	if (!is_typec_mux_dev(dev))
 		return 0;
 
-	return dev_fwnode(dev) == fwnode;
+	return device_match_fwnode(dev, fwnode);
 }
 
 static void *typec_mux_match(const struct fwnode_handle *fwnode,
drivers/usb/typec/retimer.c +1 -1
index 8edfdc709a28..8e1055783fe2 100644
@@ -31,7 +31,7 @@ static bool dev_name_ends_with(struct device *dev, const char *suffix)
 
 static int retimer_fwnode_match(struct device *dev, const void *fwnode)
 {
-	return dev_fwnode(dev) == fwnode && dev_name_ends_with(dev, "-retimer");
+	return device_match_fwnode(dev, fwnode) && dev_name_ends_with(dev, "-retimer");
 }
 
 static void *typec_retimer_match(const struct fwnode_handle *fwnode, const char *id, void *data)
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Andy Shevchenko

Replace custom implementation of the device_match_fwnode().

Quoted 32 lines
---
 drivers/usb/typec/mux.c     | 4 ++--
 drivers/usb/typec/retimer.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/typec/mux.c +2 -2
index f81ea26ab389..c7177ddd4f12 100644
@@ -29,7 +29,7 @@ static int switch_fwnode_match(struct device *dev, const void *fwnode)
 	if (!is_typec_switch_dev(dev))
 		return 0;
 
-	return dev_fwnode(dev) == fwnode;
+	return device_match_fwnode(dev, fwnode);
 }
 
 static void *typec_switch_match(const struct fwnode_handle *fwnode,
@@ -259,7 +259,7 @@ static int mux_fwnode_match(struct device *dev, const void *fwnode)
 	if (!is_typec_mux_dev(dev))
 		return 0;
 
-	return dev_fwnode(dev) == fwnode;
+	return device_match_fwnode(dev, fwnode);
 }
 
 static void *typec_mux_match(const struct fwnode_handle *fwnode,
drivers/usb/typec/retimer.c +0 -0
index 8edfdc709a28..8e1055783fe2 100644

drivers/usb/typec/retimer.c static bool dev_name_ends_with(struct device *dev, const char *suffix) · line 37

Quoted 8 lines
drivers/usb/typec/retimer.c +1 -1
@@ -31,7 +31,7 @@ static bool dev_name_ends_with(struct device *dev, const char *suffix)
 
 static int retimer_fwnode_match(struct device *dev, const void *fwnode)
 {
-	return dev_fwnode(dev) == fwnode && dev_name_ends_with(dev, "-retimer");
+	return device_match_fwnode(dev, fwnode) && dev_name_ends_with(dev, "-retimer");
 }
 
 static void *typec_retimer_match(const struct fwnode_handle *fwnode, const char *id, void *data)

thanks,

Signature · 1 line
heikki