blob: 7a7a1837f303cfd150ed381d51b7c784a86916cc [file] [log] [blame]
From 1210c0f7d5dbaa72899e8448899c10900d1bfdff Mon Sep 17 00:00:00 2001
From: Geert Uytterhoeven <geert+renesas@glider.be>
Date: Wed, 28 Feb 2018 10:13:00 +0100
Subject: [PATCH 1104/1795] ARM: shmobile: rcar-gen2: Fix error check in
regulator quirk
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>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
(cherry picked from commit 60fc75bdf5b1b8ed3e0a372b7b35f27726ff542b)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
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 27fb3a5ec73e..93f628acfd94 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.19.0