From: Michael Brunner <mibru@gmx.de>
To: linux-kernel@vger.kernel.org
Cc: Kevin Strasser <kevin.strasser@linux.intel.com>,
Kevin Strasser <strassek@engr.orst.edu>,
Darren Hart <dvhart@linux.intel.com>,
Samuel Ortiz <sameo@linux.intel.com>,
Guenter Roeck <linux@roeck-us.net>,
Michael Brunner <Michael.Brunner@kontron.com>,
Chris Healy <chealy@imsco-us.com>,
Dirk Hohndel <Dirk.Hohndel@intel.com>,
Wolfram Sang <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org
Subject: [PATCH] i2c: Fix Kontron PLD prescaler calculation
Date: Fri, 26 Jul 2013 14:04:55 +0200 [thread overview]
Message-ID: <20130726140455.40b4b86b@hyperion> (raw)
Add some necessary braces that have been removed during driver cleanup.
This fixes the I2C prescaler calculation.
Signed-off-by: Michael Brunner <michael.brunner@kontron.com>
---
drivers/i2c/busses/i2c-kempld.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index ccec916..af8f65f 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -246,9 +246,9 @@ static void kempld_i2c_device_init(struct kempld_i2c_data *i2c)
bus_frequency = KEMPLD_I2C_FREQ_MAX;
if (pld->info.spec_major == 1)
- prescale = pld->pld_clock / bus_frequency * 5 - 1000;
+ prescale = pld->pld_clock / (bus_frequency * 5) - 1000;
else
- prescale = pld->pld_clock / bus_frequency * 4 - 3000;
+ prescale = pld->pld_clock / (bus_frequency * 4) - 3000;
if (prescale < 0)
prescale = 0;
next reply other threads:[~2013-07-26 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 12:04 Michael Brunner [this message]
2013-08-02 3:48 ` [PATCH] i2c: Fix Kontron PLD prescaler calculation Guenter Roeck
2013-08-05 8:35 ` 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=20130726140455.40b4b86b@hyperion \
--to=mibru@gmx.de \
--cc=Dirk.Hohndel@intel.com \
--cc=Michael.Brunner@kontron.com \
--cc=chealy@imsco-us.com \
--cc=dvhart@linux.intel.com \
--cc=kevin.strasser@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sameo@linux.intel.com \
--cc=strassek@engr.orst.edu \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).