All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: Fix Kontron PLD prescaler calculation
@ 2013-07-26 12:04 ` Michael Brunner
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Brunner @ 2013-07-26 12:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Kevin Strasser, Kevin Strasser, Darren Hart, Samuel Ortiz,
	Guenter Roeck, Michael Brunner, Chris Healy, Dirk Hohndel,
	Wolfram Sang, linux-i2c

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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] i2c: Fix Kontron PLD prescaler calculation
@ 2013-07-26 12:04 ` Michael Brunner
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Brunner @ 2013-07-26 12:04 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Kevin Strasser, Kevin Strasser, Darren Hart, Samuel Ortiz,
	Guenter Roeck, Michael Brunner, Chris Healy, Dirk Hohndel,
	Wolfram Sang, linux-i2c-u79uwXL29TY76Z2rM5mHXA

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;

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: Fix Kontron PLD prescaler calculation
  2013-07-26 12:04 ` Michael Brunner
@ 2013-08-02  3:48   ` Guenter Roeck
  -1 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2013-08-02  3:48 UTC (permalink / raw)
  To: Michael Brunner
  Cc: linux-kernel, Kevin Strasser, Kevin Strasser, Darren Hart,
	Samuel Ortiz, Michael Brunner, Chris Healy, Dirk Hohndel,
	Wolfram Sang, linux-i2c

On Fri, Jul 26, 2013 at 02:04:55PM +0200, Michael Brunner wrote:
> 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>

Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>

Guenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: Fix Kontron PLD prescaler calculation
@ 2013-08-02  3:48   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2013-08-02  3:48 UTC (permalink / raw)
  To: Michael Brunner
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Strasser,
	Kevin Strasser, Darren Hart, Samuel Ortiz, Michael Brunner,
	Chris Healy, Dirk Hohndel, Wolfram Sang,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

On Fri, Jul 26, 2013 at 02:04:55PM +0200, Michael Brunner wrote:
> 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>

Tested-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
Reviewed-by: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>

Guenter

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: Fix Kontron PLD prescaler calculation
  2013-07-26 12:04 ` Michael Brunner
@ 2013-08-05  8:35   ` Wolfram Sang
  -1 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2013-08-05  8:35 UTC (permalink / raw)
  To: Michael Brunner
  Cc: linux-kernel, Kevin Strasser, Kevin Strasser, Darren Hart,
	Samuel Ortiz, Guenter Roeck, Michael Brunner, Chris Healy,
	Dirk Hohndel, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

On Fri, Jul 26, 2013 at 02:04:55PM +0200, Michael Brunner wrote:
> 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>

Applied to for-current, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] i2c: Fix Kontron PLD prescaler calculation
@ 2013-08-05  8:35   ` Wolfram Sang
  0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2013-08-05  8:35 UTC (permalink / raw)
  To: Michael Brunner
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kevin Strasser,
	Kevin Strasser, Darren Hart, Samuel Ortiz, Guenter Roeck,
	Michael Brunner, Chris Healy, Dirk Hohndel,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 319 bytes --]

On Fri, Jul 26, 2013 at 02:04:55PM +0200, Michael Brunner wrote:
> 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>

Applied to for-current, thanks!


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-05  8:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 12:04 [PATCH] i2c: Fix Kontron PLD prescaler calculation Michael Brunner
2013-07-26 12:04 ` 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

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.