]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers-misc-lis3lv02d-lis3lv02d_i2cc-add-lis3lv02d-device-tree-init-fix
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 26 Sep 2012 01:34:16 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 26 Sep 2012 05:45:18 +0000 (15:45 +1000)
fix CONFIG_OF=n build

drivers/misc/lis3lv02d/lis3lv02d_i2c.c: In function 'lis3lv02d_i2c_probe':
drivers/misc/lis3lv02d/lis3lv02d_i2c.c:120: error: implicit declaration of function 'of_match_device'
drivers/misc/lis3lv02d/lis3lv02d_i2c.c:121: error: 'struct lis3lv02d' has no member named 'of_node'

Cc: AnilKumar Ch <anilkumar@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Eric Piel <eric.piel@tremplin-utc.net>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/misc/lis3lv02d/lis3lv02d_i2c.c

index 43e3f2938aeb315ad58116486a02ae68cb42290d..f6fa81be6301a49d3d2b9378e2f52225821220b6 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/delay.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/of_device.h>
 
 #include "lis3lv02d.h"
 
@@ -105,11 +106,13 @@ static int lis3_i2c_init(struct lis3lv02d *lis3)
 static union axis_conversion lis3lv02d_axis_map =
        { .as_array = { LIS3_DEV_X, LIS3_DEV_Y, LIS3_DEV_Z } };
 
+#ifdef CONFIG_OF
 static struct of_device_id lis3lv02d_i2c_dt_ids[] = {
        { .compatible = "st,lis3lv02d" },
        {}
 };
 MODULE_DEVICE_TABLE(of, lis3lv02d_i2c_dt_ids);
+#endif
 
 static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
                                        const struct i2c_device_id *id)
@@ -117,6 +120,7 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
        int ret = 0;
        struct lis3lv02d_platform_data *pdata = client->dev.platform_data;
 
+#ifdef CONFIG_OF
        if (of_match_device(lis3lv02d_i2c_dt_ids, &client->dev)) {
                lis3_dev.of_node = client->dev.of_node;
                ret = lis3lv02d_init_dt(&lis3_dev);
@@ -124,6 +128,7 @@ static int __devinit lis3lv02d_i2c_probe(struct i2c_client *client,
                        return ret;
                pdata = lis3_dev.pdata;
        }
+#endif
 
        if (pdata) {
                if ((pdata->driver_features & LIS3_USE_BLOCK_READ) &&