diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 15:36:02 -0500 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 10:02:17 +0000 |
commit | 0db434f513d5cde5420787f737c7538b21f93998 (patch) | |
tree | 0810627f37a29f062f6cbb2fbc28361fa3437fc2 /drivers/mfd/max14577.c | |
parent | 830fafce06e6fc2e63e141799833f7c7a73cf62b (diff) |
mfd: Use i2c_get_match_data() in a selection of drivers
Use preferred i2c_get_match_data() instead of of_match_device() and
i2c driver_data to get the driver match data. With this, adjust the
includes to explicitly include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Link: https://lore.kernel.org/r/20231017203603.2700864-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/max14577.c')
-rw-r--r-- | drivers/mfd/max14577.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/mfd/max14577.c b/drivers/mfd/max14577.c index 1f4f5002595c..8f7472c76009 100644 --- a/drivers/mfd/max14577.c +++ b/drivers/mfd/max14577.c @@ -9,9 +9,10 @@ // This driver is based on max8997.c #include <linux/err.h> +#include <linux/i2c.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/interrupt.h> -#include <linux/of_device.h> #include <linux/mfd/core.h> #include <linux/mfd/max14577.h> #include <linux/mfd/max14577-private.h> @@ -357,7 +358,6 @@ static void max77836_remove(struct max14577 *max14577) static int max14577_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); struct max14577 *max14577; struct max14577_platform_data *pdata = dev_get_platdata(&i2c->dev); struct device_node *np = i2c->dev.of_node; @@ -397,15 +397,7 @@ static int max14577_i2c_probe(struct i2c_client *i2c) return ret; } - if (np) { - const struct of_device_id *of_id; - - of_id = of_match_device(max14577_dt_match, &i2c->dev); - if (of_id) - max14577->dev_type = (uintptr_t)of_id->data; - } else { - max14577->dev_type = id->driver_data; - } + max14577->dev_type = (enum maxim_device_type)i2c_get_match_data(i2c); max14577_print_dev_type(max14577); |