mfd: Use i2c_get_match_data() in a selection of drivers
[linux-2.6-microblaze.git] / drivers / mfd / lochnagar-i2c.c
index 59092f8..0b76fcc 100644 (file)
@@ -15,8 +15,8 @@
 #include <linux/i2c.h>
 #include <linux/lockdep.h>
 #include <linux/mfd/core.h>
+#include <linux/mod_devicetable.h>
 #include <linux/mutex.h>
-#include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/regmap.h>
 
@@ -270,7 +270,6 @@ static int lochnagar_i2c_probe(struct i2c_client *i2c)
 {
        struct device *dev = &i2c->dev;
        const struct lochnagar_config *config = NULL;
-       const struct of_device_id *of_id;
        struct lochnagar *lochnagar;
        struct gpio_desc *reset, *present;
        unsigned int val;
@@ -282,11 +281,7 @@ static int lochnagar_i2c_probe(struct i2c_client *i2c)
        if (!lochnagar)
                return -ENOMEM;
 
-       of_id = of_match_device(lochnagar_of_match, dev);
-       if (!of_id)
-               return -EINVAL;
-
-       config = of_id->data;
+       config = i2c_get_match_data(i2c);
 
        lochnagar->dev = dev;
        mutex_init(&lochnagar->analogue_config_lock);