#include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/thermal.h>
 
 
 struct axp20x_adc_iio {
        struct regmap           *regmap;
-       struct axp_data         *data;
+       const struct axp_data   *data;
 };
 
 enum axp20x_adc_channel_v {
        info->regmap = axp20x_dev->regmap;
        indio_dev->modes = INDIO_DIRECT_MODE;
 
-       if (!pdev->dev.of_node) {
+       if (!dev_fwnode(&pdev->dev)) {
                const struct platform_device_id *id;
 
                id = platform_get_device_id(pdev);
-               info->data = (struct axp_data *)id->driver_data;
+               info->data = (const struct axp_data *)id->driver_data;
        } else {
                struct device *dev = &pdev->dev;
 
-               info->data = (struct axp_data *)of_device_get_match_data(dev);
+               info->data = device_get_match_data(dev);
        }
 
        indio_dev->name = platform_get_device_id(pdev)->name;
 static struct platform_driver axp20x_adc_driver = {
        .driver = {
                .name = "axp20x-adc",
-               .of_match_table = of_match_ptr(axp20x_adc_of_match),
+               .of_match_table = axp20x_adc_of_match,
        },
        .id_table = axp20x_adc_id_match,
        .probe = axp20x_probe,