From patchwork Tue Aug 9 09:19:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 1048642 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p799LIZZ006371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 9 Aug 2011 09:21:38 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QqiUd-0005K7-Ag; Tue, 09 Aug 2011 09:20:59 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QqiUc-0001sP-9W; Tue, 09 Aug 2011 09:20:58 +0000 Received: from service87.mimecast.com ([94.185.240.25]) by canuck.infradead.org with smtp (Exim 4.76 #1 (Red Hat Linux)) id 1QqiTV-0001K7-Qi for linux-arm-kernel@lists.infradead.org; Tue, 09 Aug 2011 09:19:51 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Tue, 09 Aug 2011 10:19:19 +0100 Received: from localhost.localdomain ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Aug 2011 10:19:15 +0100 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: tegra: fix i2c-tegra compilation when !CONFIG_OF Date: Tue, 9 Aug 2011 10:19:03 +0100 Message-Id: <1312881543-3467-1-git-send-email-marc.zyngier@arm.com> X-Mailer: git-send-email 1.7.0.4 X-OriginalArrivalTime: 09 Aug 2011 09:19:15.0536 (UTC) FILETIME=[68BE3500:01CC5675] X-MC-Unique: 111080910191902701 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110809_051950_098224_85FA3239 X-CRM114-Status: GOOD ( 10.19 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [94.185.240.25 listed in list.dnswl.org] Cc: John Bonesio , Grant Likely , OIof Johansson , Ben Dooks X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 09 Aug 2011 09:21:38 +0000 (UTC) Commit 5c470f39ee (i2c: Tegra: Add DeviceTree support) broke the non-DT case. Fix it by using of_property_read_u32() instead of of_get_property(), as this is defined in all cases. Cc: John Bonesio Cc: Grant Likely Cc: OIof Johansson Cc: Ben Dooks Signed-off-by: Marc Zyngier --- drivers/i2c/busses/i2c-tegra.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 2440b74..34c9951 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -547,7 +547,6 @@ static int tegra_i2c_probe(struct platform_device *pdev) struct resource *iomem; struct clk *clk; struct clk *i2c_clk; - const unsigned int *prop; void *base; int irq; int ret = 0; @@ -610,12 +609,9 @@ static int tegra_i2c_probe(struct platform_device *pdev) if (pdata) { i2c_dev->bus_clk_rate = pdata->bus_clk_rate; - } else if (i2c_dev->dev->of_node) { /* if there is a device tree node ... */ - prop = of_get_property(i2c_dev->dev->of_node, - "clock-frequency", NULL); - if (prop) - i2c_dev->bus_clk_rate = be32_to_cpup(prop); - } + } else if (i2c_dev->dev->of_node) /* if there is a device tree node ... */ + of_property_read_u32(i2c_dev->dev->of_node, "clock-frequency", + (u32 *)&i2c_dev->bus_clk_rate); if (pdev->id == 3) i2c_dev->is_dvc = 1;