summaryrefslogtreecommitdiff
path: root/drivers/mfd/lochnagar-i2c.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-17 23:36:02 +0300
committerLee Jones <lee@kernel.org>2023-11-01 13:02:17 +0300
commit0db434f513d5cde5420787f737c7538b21f93998 (patch)
tree0810627f37a29f062f6cbb2fbc28361fa3437fc2 /drivers/mfd/lochnagar-i2c.c
parent830fafce06e6fc2e63e141799833f7c7a73cf62b (diff)
downloadlinux-0db434f513d5cde5420787f737c7538b21f93998.tar.xz
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/lochnagar-i2c.c')
-rw-r--r--drivers/mfd/lochnagar-i2c.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mfd/lochnagar-i2c.c b/drivers/mfd/lochnagar-i2c.c
index 59092f839d65..0b76fcccd0bd 100644
--- a/drivers/mfd/lochnagar-i2c.c
+++ b/drivers/mfd/lochnagar-i2c.c
@@ -15,8 +15,8 @@
#include <linux/i2c.h>
#include <linux/lockdep.h>
#include <linux/mfd/core.h>
+#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
-#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/regmap.h>
@@ -270,7 +270,6 @@ static int lochnagar_i2c_probe(struct i2c_client *i2c)
{
struct device *dev = &i2c->dev;
const struct lochnagar_config *config = NULL;
- const struct of_device_id *of_id;
struct lochnagar *lochnagar;
struct gpio_desc *reset, *present;
unsigned int val;
@@ -282,11 +281,7 @@ static int lochnagar_i2c_probe(struct i2c_client *i2c)
if (!lochnagar)
return -ENOMEM;
- of_id = of_match_device(lochnagar_of_match, dev);
- if (!of_id)
- return -EINVAL;
-
- config = of_id->data;
+ config = i2c_get_match_data(i2c);
lochnagar->dev = dev;
mutex_init(&lochnagar->analogue_config_lock);