All of lore.kernel.org
 help / color / mirror / Atom feed
From: marc.zyngier@arm.com (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	[thread overview]
Message-ID: <1312881543-3467-1-git-send-email-marc.zyngier@arm.com> (raw)

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 <bones@secretlab.ca>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: OIof Johansson <olof@lixom.net>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 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;
-- 
1.7.0.4

             reply	other threads:[~2011-08-09  9:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09  9:19 Marc Zyngier [this message]
2011-08-09 17:25 ` [PATCH] ARM: tegra: fix i2c-tegra compilation when !CONFIG_OF Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1312881543-3467-1-git-send-email-marc.zyngier@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.