usb: typec: tipd: rely on i2c_get_match_data()
authorJavier Carrasco <javier.carrasco@wolfvision.net>
Mon, 29 Apr 2024 13:35:59 +0000 (15:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 May 2024 09:36:51 +0000 (10:36 +0100)
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: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20240429-tps6598x_fix_event_handling-v3-3-4e8e58dce489@wolfvision.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tipd/core.c

index 191f86da283d007cd6ab5d51abe29914b2c6821d..ad76dbd20e650c9aa684e64d0286a50e194dd36b 100644 (file)
@@ -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;