From 85d85a7f5441fd845ec4b149432d074eaa9196ca Mon Sep 17 00:00:00 2001 From: AnilKumar Ch Date: Wed, 26 Sep 2012 11:34:15 +1000 Subject: [PATCH] drivers/misc/lis3lv02d/lis3lv02d_spi.c: add lis3lv02d device tree init Add lis3lv02d device tree initialization code/API to take pdata from device node. Also remove CONFIG_OF ifdef from the driver, if CONFIG_OF is not defined then OF APIs returns 0. Signed-off-by: AnilKumar Ch Cc: Eric Piel Reviewed-by: Arnd Bergmann Cc: Mark Brown Cc: Tony Lindgren Signed-off-by: Andrew Morton --- drivers/misc/lis3lv02d/lis3lv02d_spi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index 4b8ccf200194..793a033954ae 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -86,10 +86,12 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi) lis3_dev.ac = lis3lv02d_axis_normal; lis3_dev.pdata = spi->dev.platform_data; -#ifdef CONFIG_OF - if (of_match_device(lis302dl_spi_dt_ids, &spi->dev)) + if (of_match_device(lis302dl_spi_dt_ids, &spi->dev)) { lis3_dev.of_node = spi->dev.of_node; -#endif + ret = lis3lv02d_init_dt(&lis3_dev); + if (ret) + return ret; + } spi_set_drvdata(spi, &lis3_dev); -- 2.39.5