All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: shmobile: rcar-gen2: Fix error check in regulator quirk
@ 2018-02-28  9:13 Geert Uytterhoeven
  2018-02-28 13:26 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2018-02-28  9:13 UTC (permalink / raw)
  To: Simon Horman, Magnus Damm, Marek Vasut
  Cc: linux-renesas-soc, Geert Uytterhoeven

On systems with two regulators, a bogus error message is printed on
success:

    i2c 6-0058: i2c error 2

While adding support for Stout, the number of messages to send was
made variable, but the corresponding return value check of
i2c_transfer() wasn't updated.

Fixes: ff938cd14d67a704 ("ARM: shmobile: stout: enable R-Car Gen2 regulator quirk")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
index 27fb3a5ec73e6dda..93f628acfd944fd5 100644
--- a/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
@@ -98,7 +98,7 @@ static int regulator_quirk_notify(struct notifier_block *nb,
 
 		dev_info(&client->dev, "clearing da9063/da9210 interrupts\n");
 		ret = i2c_transfer(client->adapter, da9xxx_msgs, len);
-		if (ret != ARRAY_SIZE(da9xxx_msgs))
+		if (ret != len)
 			dev_err(&client->dev, "i2c error %d\n", ret);
 	}
 
-- 
2.7.4

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

* Re: [PATCH] ARM: shmobile: rcar-gen2: Fix error check in regulator quirk
  2018-02-28  9:13 [PATCH] ARM: shmobile: rcar-gen2: Fix error check in regulator quirk Geert Uytterhoeven
@ 2018-02-28 13:26 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2018-02-28 13:26 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Magnus Damm, Marek Vasut, linux-renesas-soc

On Wed, Feb 28, 2018 at 10:13:00AM +0100, Geert Uytterhoeven wrote:
> On systems with two regulators, a bogus error message is printed on
> success:
> 
>     i2c 6-0058: i2c error 2
> 
> While adding support for Stout, the number of messages to send was
> made variable, but the corresponding return value check of
> i2c_transfer() wasn't updated.
> 
> Fixes: ff938cd14d67a704 ("ARM: shmobile: stout: enable R-Car Gen2 regulator quirk")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, applied.

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

end of thread, other threads:[~2018-02-28 13:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28  9:13 [PATCH] ARM: shmobile: rcar-gen2: Fix error check in regulator quirk Geert Uytterhoeven
2018-02-28 13:26 ` Simon Horman

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.