diff mbox series

[v2] usb: typec: mux: Fix copy-paste mistake in typec_mux_match

Message ID 20210610002132.3088083-1-bjorn.andersson@linaro.org (mailing list archive)
State Accepted
Commit 142d0b24c1b17139f1aaaacae7542a38aa85640f
Headers show
Series [v2] usb: typec: mux: Fix copy-paste mistake in typec_mux_match | expand

Commit Message

Bjorn Andersson June 10, 2021, 12:21 a.m. UTC
Fix the copy-paste mistake in the return path of typec_mux_match(),
where dev is considered a member of struct typec_switch rather than
struct typec_mux.

The two structs are identical in regards to having the struct device as
the first entry, so this provides no functional change.

Fixes: 3370db35193b ("usb: typec: Registering real device entries for the muxes")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v1:
- Don't touch the typec_switch part of mux.c...

 drivers/usb/typec/mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heikki Krogerus June 10, 2021, 12:33 p.m. UTC | #1
On Wed, Jun 09, 2021 at 05:21:32PM -0700, Bjorn Andersson wrote:
> Fix the copy-paste mistake in the return path of typec_mux_match(),
> where dev is considered a member of struct typec_switch rather than
> struct typec_mux.
> 
> The two structs are identical in regards to having the struct device as
> the first entry, so this provides no functional change.
> 
> Fixes: 3370db35193b ("usb: typec: Registering real device entries for the muxes")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
> 
> Changes since v1:
> - Don't touch the typec_switch part of mux.c...
> 
>  drivers/usb/typec/mux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
> index 664fb3513f48..c8340de0ed49 100644
> --- a/drivers/usb/typec/mux.c
> +++ b/drivers/usb/typec/mux.c
> @@ -246,7 +246,7 @@ static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id,
>  	dev = class_find_device(&typec_mux_class, NULL, fwnode,
>  				mux_fwnode_match);
>  
> -	return dev ? to_typec_switch(dev) : ERR_PTR(-EPROBE_DEFER);
> +	return dev ? to_typec_mux(dev) : ERR_PTR(-EPROBE_DEFER);
>  }
>  
>  /**
diff mbox series

Patch

diff --git a/drivers/usb/typec/mux.c b/drivers/usb/typec/mux.c
index 664fb3513f48..c8340de0ed49 100644
--- a/drivers/usb/typec/mux.c
+++ b/drivers/usb/typec/mux.c
@@ -246,7 +246,7 @@  static void *typec_mux_match(struct fwnode_handle *fwnode, const char *id,
 	dev = class_find_device(&typec_mux_class, NULL, fwnode,
 				mux_fwnode_match);
 
-	return dev ? to_typec_switch(dev) : ERR_PTR(-EPROBE_DEFER);
+	return dev ? to_typec_mux(dev) : ERR_PTR(-EPROBE_DEFER);
 }
 
 /**