usb: typec: Replace custom implementation of device_match_fwnode()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 27 Sep 2022 17:19:24 +0000 (20:19 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2022 11:55:13 +0000 (13:55 +0200)
Replace custom implementation of the device_match_fwnode().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20220927171924.61908-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/mux.c
drivers/usb/typec/retimer.c

index 464330776cd615eb09d6dd0a332f297fa2f9545c..941735c731619c9841d57d32599006c2180bbe31 100644 (file)
@@ -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(struct fwnode_handle *fwnode, const char *id,
@@ -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(struct fwnode_handle *fwnode, const char *id,
index 2003731f1bee148a471b285652852561b4af6779..ee94dbbe4745306115bb4be5e0796e247b4b9084 100644 (file)
@@ -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(struct fwnode_handle *fwnode, const char *id, void *data)