#include <linux/i2c.h>
 #include <linux/iio/iio.h>
 #include <linux/module.h>
-#include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/mod_devicetable.h>
+#include <linux/property.h>
 
 #define MCP4018_WIPER_MAX 127
 
 };
 MODULE_DEVICE_TABLE(i2c, mcp4018_id);
 
-#ifdef CONFIG_OF
-
 #define MCP4018_COMPATIBLE(of_compatible, cfg) {       \
        .compatible = of_compatible,                    \
        .data = &mcp4018_cfg[cfg],                      \
 };
 MODULE_DEVICE_TABLE(of, mcp4018_of_match);
 
-#endif
-
 static int mcp4018_probe(struct i2c_client *client)
 {
        struct device *dev = &client->dev;
        i2c_set_clientdata(client, indio_dev);
        data->client = client;
 
-       data->cfg = of_device_get_match_data(dev);
+       data->cfg = device_get_match_data(dev);
        if (!data->cfg)
                data->cfg = &mcp4018_cfg[i2c_match_id(mcp4018_id, client)->driver_data];
 
 static struct i2c_driver mcp4018_driver = {
        .driver = {
                .name   = "mcp4018",
-               .of_match_table = of_match_ptr(mcp4018_of_match),
+               .of_match_table = mcp4018_of_match,
        },
        .probe_new      = mcp4018_probe,
        .id_table       = mcp4018_id,