diff options
Diffstat (limited to 'drivers/misc/lis3lv02d/lis3lv02d_spi.c')
-rw-r--r-- | drivers/misc/lis3lv02d/lis3lv02d_spi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_spi.c b/drivers/misc/lis3lv02d/lis3lv02d_spi.c index 4b8ccf200194..ccb6475fa059 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -19,6 +19,7 @@ #include <linux/pm.h> #include <linux/of.h> #include <linux/of_platform.h> +#include <linux/of_device.h> #include "lis3lv02d.h" @@ -87,10 +88,13 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi) 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; + ret = lis3lv02d_init_dt(&lis3_dev); + if (ret) + return ret; + } #endif - spi_set_drvdata(spi, &lis3_dev); return lis3lv02d_init_device(&lis3_dev); |