From patchwork Fri Sep 14 08:06:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "AnilKumar, Chimata" X-Patchwork-Id: 1456141 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 26CB5402E1 for ; Fri, 14 Sep 2012 08:07:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758139Ab2INIHx (ORCPT ); Fri, 14 Sep 2012 04:07:53 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:46293 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755668Ab2INIHn (ORCPT ); Fri, 14 Sep 2012 04:07:43 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8E87H8Z020991; Fri, 14 Sep 2012 03:07:18 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8E87803029089; Fri, 14 Sep 2012 13:37:08 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Fri, 14 Sep 2012 13:37:08 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q8E86wqp029957; Fri, 14 Sep 2012 13:37:07 +0530 From: AnilKumar Ch To: CC: , , , , , , , , , , , , AnilKumar Ch Subject: [PATCH v2 2/4] lis3: lis3lv02d_spi: Add lis3lv02d device tree init Date: Fri, 14 Sep 2012 13:36:54 +0530 Message-ID: <1347610016-10123-3-git-send-email-anilkumar@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1347610016-10123-1-git-send-email-anilkumar@ti.com> References: <1347610016-10123-1-git-send-email-anilkumar@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- 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 23f3986..e1db6f4 100644 --- a/drivers/misc/lis3lv02d/lis3lv02d_spi.c +++ b/drivers/misc/lis3lv02d/lis3lv02d_spi.c @@ -84,10 +84,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);