diff options
author | Rob Herring <robh@kernel.org> | 2023-10-17 23:36:10 +0300 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-11-01 13:02:17 +0300 |
commit | 830fafce06e6fc2e63e141799833f7c7a73cf62b (patch) | |
tree | d9b5f379a230da54e8a8b70c1095c2e65d72acbb /drivers/mfd/axp20x.c | |
parent | 15d71e678ec14ce26f7a271fef363e5c04ec24bf (diff) | |
download | linux-830fafce06e6fc2e63e141799833f7c7a73cf62b.tar.xz |
mfd: Use device_get_match_data() in a bunch of drivers
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231017203612.2701060-1-robh@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/axp20x.c')
-rw-r--r-- | drivers/mfd/axp20x.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index d93189b0230d..deaa969bab4e 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -22,7 +22,8 @@ #include <linux/mfd/axp20x.h> #include <linux/mfd/core.h> #include <linux/module.h> -#include <linux/of_device.h> +#include <linux/of.h> +#include <linux/property.h> #include <linux/reboot.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h> @@ -1131,27 +1132,10 @@ static int axp20x_power_off(struct sys_off_data *data) int axp20x_match_device(struct axp20x_dev *axp20x) { struct device *dev = axp20x->dev; - const struct acpi_device_id *acpi_id; - const struct of_device_id *of_id; const struct mfd_cell *cells_no_irq = NULL; int nr_cells_no_irq = 0; - if (dev->of_node) { - of_id = of_match_device(dev->driver->of_match_table, dev); - if (!of_id) { - dev_err(dev, "Unable to match OF ID\n"); - return -ENODEV; - } - axp20x->variant = (long)of_id->data; - } else { - acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); - if (!acpi_id || !acpi_id->driver_data) { - dev_err(dev, "Unable to match ACPI ID and data\n"); - return -ENODEV; - } - axp20x->variant = (long)acpi_id->driver_data; - } - + axp20x->variant = (long)device_get_match_data(dev); switch (axp20x->variant) { case AXP152_ID: axp20x->nr_cells = ARRAY_SIZE(axp152_cells); |