All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] usb: typec: Replace custom implementation of device_match_fwnode()
@ 2022-09-27 17:19 Andy Shevchenko
  2022-09-28  7:33 ` Heikki Krogerus
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-09-27 17:19 UTC (permalink / raw)
  To: Bjorn Andersson, Prashant Malani, linux-usb, linux-kernel
  Cc: Heikki Krogerus, Greg Kroah-Hartman, Andy Shevchenko

Replace custom implementation of the device_match_fwnode().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/typec/mux.c     | 4 ++--
 drivers/usb/typec/retimer.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
index f81ea26ab389..c7177ddd4f12 100644
--- a/drivers/usb/typec/mux.c
+++ b/drivers/usb/typec/mux.c
@@ -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,
diff --git a/drivers/usb/typec/retimer.c b/drivers/usb/typec/retimer.c
index 8edfdc709a28..8e1055783fe2 100644
--- a/drivers/usb/typec/retimer.c
+++ b/drivers/usb/typec/retimer.c
@@ -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)
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1 1/1] usb: typec: Replace custom implementation of device_match_fwnode()
  2022-09-27 17:19 [PATCH v1 1/1] usb: typec: Replace custom implementation of device_match_fwnode() Andy Shevchenko
@ 2022-09-28  7:33 ` Heikki Krogerus
  0 siblings, 0 replies; 2+ messages in thread
From: Heikki Krogerus @ 2022-09-28  7:33 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Bjorn Andersson, Prashant Malani, linux-usb, linux-kernel,
	Greg Kroah-Hartman

On Tue, Sep 27, 2022 at 08:19:24PM +0300, Andy Shevchenko wrote:
> 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>

> ---
>  drivers/usb/typec/mux.c     | 4 ++--
>  drivers/usb/typec/retimer.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
> index f81ea26ab389..c7177ddd4f12 100644
> --- a/drivers/usb/typec/mux.c
> +++ b/drivers/usb/typec/mux.c
> @@ -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,
> diff --git a/drivers/usb/typec/retimer.c b/drivers/usb/typec/retimer.c
> index 8edfdc709a28..8e1055783fe2 100644
> --- a/drivers/usb/typec/retimer.c
> +++ b/drivers/usb/typec/retimer.c
> @@ -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,

-- 
heikki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-28  7:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 17:19 [PATCH v1 1/1] usb: typec: Replace custom implementation of device_match_fwnode() Andy Shevchenko
2022-09-28  7:33 ` Heikki Krogerus

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.