From 4935eb640469175340eef3965546eec04cf4d12e Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 26 Sep 2012 11:34:16 +1000 Subject: [PATCH] drivers-misc-lis3lv02d-lis3lv02d_i2cc-add-lis3lv02d-device-tree-init-fix 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 Cc: Arnd Bergmann Cc: Eric Piel Cc: Mark Brown Cc: Tony Lindgren Signed-off-by: Andrew Morton --- drivers/misc/lis3lv02d/lis3lv02d_i2c.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c index 43e3f2938aeb..f6fa81be6301 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c @@ -33,6 +33,7 @@ #include #include #include +#include #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) && -- 2.39.5