|
22 | 22 | #include <linux/mfd/axp20x.h> |
23 | 23 | #include <linux/mfd/core.h> |
24 | 24 | #include <linux/module.h> |
25 | | -#include <linux/of_device.h> |
| 25 | +#include <linux/of.h> |
| 26 | +#include <linux/property.h> |
26 | 27 | #include <linux/reboot.h> |
27 | 28 | #include <linux/regmap.h> |
28 | 29 | #include <linux/regulator/consumer.h> |
@@ -1131,27 +1132,10 @@ static int axp20x_power_off(struct sys_off_data *data) |
1131 | 1132 | int axp20x_match_device(struct axp20x_dev *axp20x) |
1132 | 1133 | { |
1133 | 1134 | struct device *dev = axp20x->dev; |
1134 | | - const struct acpi_device_id *acpi_id; |
1135 | | - const struct of_device_id *of_id; |
1136 | 1135 | const struct mfd_cell *cells_no_irq = NULL; |
1137 | 1136 | int nr_cells_no_irq = 0; |
1138 | 1137 |
|
1139 | | - if (dev->of_node) { |
1140 | | - of_id = of_match_device(dev->driver->of_match_table, dev); |
1141 | | - if (!of_id) { |
1142 | | - dev_err(dev, "Unable to match OF ID\n"); |
1143 | | - return -ENODEV; |
1144 | | - } |
1145 | | - axp20x->variant = (long)of_id->data; |
1146 | | - } else { |
1147 | | - acpi_id = acpi_match_device(dev->driver->acpi_match_table, dev); |
1148 | | - if (!acpi_id || !acpi_id->driver_data) { |
1149 | | - dev_err(dev, "Unable to match ACPI ID and data\n"); |
1150 | | - return -ENODEV; |
1151 | | - } |
1152 | | - axp20x->variant = (long)acpi_id->driver_data; |
1153 | | - } |
1154 | | - |
| 1138 | + axp20x->variant = (long)device_get_match_data(dev); |
1155 | 1139 | switch (axp20x->variant) { |
1156 | 1140 | case AXP152_ID: |
1157 | 1141 | axp20x->nr_cells = ARRAY_SIZE(axp152_cells); |
|
0 commit comments