diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 15:35:49 -0500 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 10:02:16 +0000 |
commit | 15d71e678ec14ce26f7a271fef363e5c04ec24bf (patch) | |
tree | a1c3a3d81635b76ff54a8d3359ea63986896e9e8 /drivers/mfd/mc13xxx-spi.c | |
parent | 9f58744c5eee149fae13c64b0b8b5b4405de3aa4 (diff) |
mfd: mc13xxx-spi/wm831x-spi: Use spi_get_device_match_data()
Use preferred spi_get_device_match_data() instead of of_match_device() and
spi_get_device_id() 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>
Link: https://lore.kernel.org/r/20231017203550.2700601-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
tils.feedkeys.call.run(35)
all.run(37)
all.run(39)
Diffstat (limited to 'drivers/mfd/mc13xxx-spi.c')
-rw-r--r-- | drivers/mfd/mc13xxx-spi.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c index f70d79aa5a83..c973e2579bdf 100644 --- a/drivers/mfd/mc13xxx-spi.c +++ b/drivers/mfd/mc13xxx-spi.c @@ -8,13 +8,12 @@ */ #include <linux/slab.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/platform_device.h> #include <linux/interrupt.h> #include <linux/mfd/core.h> #include <linux/mfd/mc13xxx.h> -#include <linux/of.h> -#include <linux/of_device.h> #include <linux/err.h> #include <linux/spi/spi.h> @@ -151,16 +150,7 @@ static int mc13xxx_spi_probe(struct spi_device *spi) return ret; } - if (spi->dev.of_node) { - const struct of_device_id *of_id = - of_match_device(mc13xxx_dt_ids, &spi->dev); - - mc13xxx->variant = of_id->data; - } else { - const struct spi_device_id *id_entry = spi_get_device_id(spi); - - mc13xxx->variant = (void *)id_entry->driver_data; - } + mc13xxx->variant = spi_get_device_match_data(spi); return mc13xxx_common_init(&spi->dev); } |