From: Michael Brunner <mibru-Mmb7MZpHnFY@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Kevin Strasser
<kevin.strasser-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Kevin Strasser <strassek-29tvszzbzErpgkiH4x7ZXw@public.gmane.org>,
Darren Hart <dvhart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Samuel Ortiz <sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>,
Michael Brunner
<Michael.Brunner-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org>,
Chris Healy <chealy-KRR2zmvM+DFWk0Htik3J/w@public.gmane.org>,
Dirk Hohndel
<Dirk.Hohndel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org>
---
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;
WARNING: multiple messages have this Message-ID (diff)
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:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 12:04 Michael Brunner [this message]
2013-07-26 12:04 ` [PATCH] i2c: Fix Kontron PLD prescaler calculation Michael Brunner
2013-08-02 3:48 ` Guenter Roeck
2013-08-02 3:48 ` Guenter Roeck
2013-08-05 8:35 ` Wolfram Sang
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-mmb7mzphnfy@public.gmane.org \
--cc=Dirk.Hohndel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=Michael.Brunner-2UyDCMiLNfhBDgjK7y7TUQ@public.gmane.org \
--cc=chealy-KRR2zmvM+DFWk0Htik3J/w@public.gmane.org \
--cc=dvhart-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=kevin.strasser-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=strassek-29tvszzbzErpgkiH4x7ZXw@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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.