From patchwork Mon Sep 17 07:23:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "AnilKumar, Chimata" X-Patchwork-Id: 1465681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 3E20CDFFFF for ; Mon, 17 Sep 2012 07:28:03 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDVhM-0005ry-TB; Mon, 17 Sep 2012 07:24:54 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TDVgf-0005hR-16 for linux-arm-kernel@lists.infradead.org; Mon, 17 Sep 2012 07:24:09 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q8H7NtaN031492; Mon, 17 Sep 2012 02:23:56 -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 q8H7Nlm8012945; Mon, 17 Sep 2012 12:53:55 +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; Mon, 17 Sep 2012 12:53:46 +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 q8H7NbkP001966; Mon, 17 Sep 2012 12:53:46 +0530 From: AnilKumar Ch To: Subject: [PATCH v3 2/4] lis3: lis3lv02d_spi: Add lis3lv02d device tree init Date: Mon, 17 Sep 2012 12:53:20 +0530 Message-ID: <1347866602-2088-3-git-send-email-anilkumar@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1347866602-2088-1-git-send-email-anilkumar@ti.com> References: <1347866602-2088-1-git-send-email-anilkumar@ti.com> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -7.4 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.5 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: dmitry.torokhov@gmail.com, eric.piel@tremplin-utc.net, tony@atomide.com, gregkh@linuxfoundation.org, devicetree-discuss@lists.ozlabs.org, broonie@opensource.wolfsonmicro.com, grant.likely@secretlab.ca, jic23@cam.ac.uk, AnilKumar Ch , greg@kroah.com, akpm@linux-foundation.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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);