diff mbox series

[v3,3/3] usb: typec: tipd: rely on i2c_get_match_data()

Message ID 20240429-tps6598x_fix_event_handling-v3-3-4e8e58dce489@wolfvision.net (mailing list archive)
State Accepted
Commit 344f74cf531d90245e1296b3ffbaa7df99dd18f6
Headers show
Series usb: typec: tipd: fix event checking in interrupt service routines | expand

Commit Message

Javier Carrasco April 29, 2024, 1:35 p.m. UTC
The first thing i2c_get_match_data() does is calling
device_get_match_data(), which already checks if there is a fwnode.

Remove explicit usage of device_get_match_data() as it is already
included in i2c_get_match_data().

Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
---
 drivers/usb/typec/tipd/core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Dmitry Baryshkov April 29, 2024, 4:35 p.m. UTC | #1
On Mon, Apr 29, 2024 at 03:35:59PM +0200, Javier Carrasco wrote:
> The first thing i2c_get_match_data() does is calling
> device_get_match_data(), which already checks if there is a fwnode.
> 
> Remove explicit usage of device_get_match_data() as it is already
> included in i2c_get_match_data().
> 
> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
> ---
>  drivers/usb/typec/tipd/core.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Heikki Krogerus May 6, 2024, 8:29 a.m. UTC | #2
On Mon, Apr 29, 2024 at 03:35:59PM +0200, Javier Carrasco wrote:
> The first thing i2c_get_match_data() does is calling
> device_get_match_data(), which already checks if there is a fwnode.
> 
> Remove explicit usage of device_get_match_data() as it is already
> included in i2c_get_match_data().
> 
> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>

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

> ---
>  drivers/usb/typec/tipd/core.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 191f86da283d..ad76dbd20e65 100644
> --- a/drivers/usb/typec/tipd/core.c
> +++ b/drivers/usb/typec/tipd/core.c
> @@ -1365,10 +1365,7 @@ static int tps6598x_probe(struct i2c_client *client)
>  			TPS_REG_INT_PLUG_EVENT;
>  	}
>  
> -	if (dev_fwnode(tps->dev))
> -		tps->data = device_get_match_data(tps->dev);
> -	else
> -		tps->data = i2c_get_match_data(client);
> +	tps->data = i2c_get_match_data(client);
>  	if (!tps->data)
>  		return -EINVAL;
>  
> 
> -- 
> 2.40.1
diff mbox series

Patch

diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
index 191f86da283d..ad76dbd20e65 100644
--- a/drivers/usb/typec/tipd/core.c
+++ b/drivers/usb/typec/tipd/core.c
@@ -1365,10 +1365,7 @@  static int tps6598x_probe(struct i2c_client *client)
 			TPS_REG_INT_PLUG_EVENT;
 	}
 
-	if (dev_fwnode(tps->dev))
-		tps->data = device_get_match_data(tps->dev);
-	else
-		tps->data = i2c_get_match_data(client);
+	tps->data = i2c_get_match_data(client);
 	if (!tps->data)
 		return -EINVAL;