From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Wolfram Sang <wsa@the-dreams.de>, linux-i2c@vger.kernel.org
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Ezequiel Garcia <ezequiel.garcia@free-electrons.com>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
linux-arm-kernel@lists.infradead.org,
Jason Cooper <jason@lakedaemon.net>, Andrew Lunn <andrew@lunn.ch>,
Gregory CLEMENT <gregory.clement@free-electrons.com>,
Nicolas Pitre <nico@fluxnic.net>,
Lior Amsalem <alior@marvell.com>,
Maen Suleiman <maen@marvell.com>,
Tawfik Bayouk <tawfik@marvell.com>,
Shadi Ammouri <shadi@marvell.com>,
Eran Ben-Avi <benavi@marvell.com>,
Yehuda Yitschak <yehuday@marvell.com>,
Nadav Haklai <nadavh@marvell.com>,
Ike Pan <ike.pan@canonical.com>,
Chris Van Hoof <vanhoof@canonical.com>,
Dan Frazier <dann.frazier@canonical.com>,
Leif Lindholm <leif.lindholm@arm.com>,
Jon Masters <jcm@redhat.com>, David Marlin <dmarlin@redhat.com>,
linux-kernel@vger.kernel.org, Zbigniew Bodek <zbb@semihalf.com>
Subject: [PATCH 2/2] i2c-mv64xxx: Abort the mv64xxx_of_config if clock-frequency is not provided
Date: Fri, 7 Jun 2013 17:49:00 +0200 [thread overview]
Message-ID: <1370620140-17177-3-git-send-email-gregory.clement@free-electrons.com> (raw)
In-Reply-To: <1370620140-17177-1-git-send-email-gregory.clement@free-electrons.com>
From: Zbigniew Bodek <zbb@semihalf.com>
This commit adds checking whether clock-frequency property acquisition
has succeeded. Do not waste time to find baud factors if there is no
information about the desired bus frequency in dts.
[gregory.clement@free-electrons.com: Reword the commit log]
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Zbigniew Bodek <zbb@semihalf.com>
---
drivers/i2c/busses/i2c-mv64xxx.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 60cac9f..88c2dd0 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -593,7 +593,9 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
goto out;
}
tclk = clk_get_rate(drv_data->clk);
- of_property_read_u32(np, "clock-frequency", &bus_freq);
+ if ((rc = of_property_read_u32(np, "clock-frequency", &bus_freq)) != 0)
+ goto out;
+
if (!mv64xxx_find_baud_factors(bus_freq, tclk,
&drv_data->freq_n, &drv_data->freq_m)) {
rc = -EINVAL;
--
1.8.1.2
next prev parent reply other threads:[~2013-06-07 15:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-07 15:48 [PATCH 0/2] i2c-mv64xxx: Various fixes Gregory CLEMENT
2013-06-07 15:48 ` [PATCH 1/2] i2c-mv64xxx: Fix timing issue on Armada XP (errata FE-8471889) Gregory CLEMENT
2013-06-07 16:25 ` Thomas Petazzoni
2013-06-14 15:24 ` Wolfram Sang
2013-06-07 15:49 ` Gregory CLEMENT [this message]
2013-06-14 15:23 ` [PATCH 2/2] i2c-mv64xxx: Abort the mv64xxx_of_config if clock-frequency is not provided Wolfram Sang
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=1370620140-17177-3-git-send-email-gregory.clement@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=benavi@marvell.com \
--cc=dann.frazier@canonical.com \
--cc=dmarlin@redhat.com \
--cc=ezequiel.garcia@free-electrons.com \
--cc=ike.pan@canonical.com \
--cc=jason@lakedaemon.net \
--cc=jcm@redhat.com \
--cc=leif.lindholm@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maen@marvell.com \
--cc=nadavh@marvell.com \
--cc=nico@fluxnic.net \
--cc=sebastian.hesselbarth@gmail.com \
--cc=shadi@marvell.com \
--cc=tawfik@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=vanhoof@canonical.com \
--cc=wsa@the-dreams.de \
--cc=yehuday@marvell.com \
--cc=zbb@semihalf.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®