summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2024-09-26 15:29:15 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-04 16:12:15 +0300
commit82375469755662b9910a22da14027cbef2bca666 (patch)
treeed5ab2266f9219a056e4a172d5773a8f0cd5e30a
parentd7e75301b5d58f985a128e3875bd2ddf2bd3943b (diff)
downloadlinux-82375469755662b9910a22da14027cbef2bca666.tar.xz
usb: typec: stusb160x: Make use of i2c_get_match_data()
Get matching data in one step by switching to use i2c_get_match_data(). As a positive side effect the matching data is qualified as a constant. 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/20240926122944.1251923-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/typec/stusb160x.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/typec/stusb160x.c b/drivers/usb/typec/stusb160x.c
index f3140fc04c12..6d85b25b40bc 100644
--- a/drivers/usb/typec/stusb160x.c
+++ b/drivers/usb/typec/stusb160x.c
@@ -633,9 +633,8 @@ MODULE_DEVICE_TABLE(of, stusb160x_of_match);
static int stusb160x_probe(struct i2c_client *client)
{
+ const struct regmap_config *regmap_config;
struct stusb160x *chip;
- const struct of_device_id *match;
- struct regmap_config *regmap_config;
struct fwnode_handle *fwnode;
int ret;
@@ -645,8 +644,8 @@ static int stusb160x_probe(struct i2c_client *client)
i2c_set_clientdata(client, chip);
- match = i2c_of_match_device(stusb160x_of_match, client);
- regmap_config = (struct regmap_config *)match->data;
+ regmap_config = i2c_get_match_data(client);
+
chip->regmap = devm_regmap_init_i2c(client, regmap_config);
if (IS_ERR(chip->regmap)) {
ret = PTR_ERR(chip->regmap);