diff options
author | ye xingchen <ye.xingchen@zte.com.cn> | 2022-11-17 19:52:24 +0800 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2022-12-07 13:28:16 +0000 |
commit | d0871b5a22b46fc81887e35e4559710cd53fcfae (patch) | |
tree | 002ad02b5744a4e44ff414319b1007a14bda0758 /drivers | |
parent | c8cf6e2328ce42ba016f6c321ba663d07e6f70ff (diff) | |
download | lwn-d0871b5a22b46fc81887e35e4559710cd53fcfae.tar.gz lwn-d0871b5a22b46fc81887e35e4559710cd53fcfae.zip |
mfd: palmas: Use device_get_match_data() to simplify the code
Directly get the match data with device_get_match_data().
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/202211171952240424511@zte.com.cn
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mfd/palmas.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index d26d82c85ba8..b8383c6cba3f 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -511,7 +511,6 @@ static int palmas_i2c_probe(struct i2c_client *i2c) int ret = 0, i; unsigned int reg, addr; int slave; - const struct of_device_id *match; pdata = dev_get_platdata(&i2c->dev); @@ -535,12 +534,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c) palmas->dev = &i2c->dev; palmas->irq = i2c->irq; - match = of_match_device(of_palmas_match_tbl, &i2c->dev); - - if (!match) - return -ENODATA; - - driver_data = (struct palmas_driver_data *)match->data; + driver_data = (struct palmas_driver_data *) device_get_match_data(&i2c->dev); palmas->features = *driver_data->features; for (i = 0; i < PALMAS_NUM_CLIENTS; i++) { |