* [PATCH] i2c: rk3x: report number of messages transmitted
@ 2015-04-20 22:14 ` Dmitry Torokhov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2015-04-20 22:14 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Wolfram Sang, Doug Anderson, Addy Ke, Max Schwarz,
Alexandru M Stan,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
master_xfer() method should return number of i2c messages transferred,
but on Rockchip we were usually returning just 1, which caused trouble
with users that actually check number of transferred messages vs.
checking for negative error codes.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/i2c/busses/i2c-rk3x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 5f96b1b..019d542 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -833,7 +833,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap,
clk_disable(i2c->clk);
spin_unlock_irqrestore(&i2c->lock, flags);
- return ret;
+ return ret < 0 ? ret : num;
}
static u32 rk3x_i2c_func(struct i2c_adapter *adap)
--
2.2.0.rc0.207.ga3a616c
--
Dmitry
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] i2c: rk3x: report number of messages transmitted
@ 2015-04-20 22:14 ` Dmitry Torokhov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2015-04-20 22:14 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Wolfram Sang, Doug Anderson, Addy Ke, Max Schwarz,
Alexandru M Stan, linux-arm-kernel, linux-rockchip, linux-i2c,
linux-kernel
master_xfer() method should return number of i2c messages transferred,
but on Rockchip we were usually returning just 1, which caused trouble
with users that actually check number of transferred messages vs.
checking for negative error codes.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/i2c/busses/i2c-rk3x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 5f96b1b..019d542 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -833,7 +833,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap,
clk_disable(i2c->clk);
spin_unlock_irqrestore(&i2c->lock, flags);
- return ret;
+ return ret < 0 ? ret : num;
}
static u32 rk3x_i2c_func(struct i2c_adapter *adap)
--
2.2.0.rc0.207.ga3a616c
--
Dmitry
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] i2c: rk3x: report number of messages transmitted
@ 2015-04-20 22:14 ` Dmitry Torokhov
0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2015-04-20 22:14 UTC (permalink / raw)
To: linux-arm-kernel
master_xfer() method should return number of i2c messages transferred,
but on Rockchip we were usually returning just 1, which caused trouble
with users that actually check number of transferred messages vs.
checking for negative error codes.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
drivers/i2c/busses/i2c-rk3x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
index 5f96b1b..019d542 100644
--- a/drivers/i2c/busses/i2c-rk3x.c
+++ b/drivers/i2c/busses/i2c-rk3x.c
@@ -833,7 +833,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap,
clk_disable(i2c->clk);
spin_unlock_irqrestore(&i2c->lock, flags);
- return ret;
+ return ret < 0 ? ret : num;
}
static u32 rk3x_i2c_func(struct i2c_adapter *adap)
--
2.2.0.rc0.207.ga3a616c
--
Dmitry
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: rk3x: report number of messages transmitted
2015-04-20 22:14 ` Dmitry Torokhov
(?)
@ 2015-04-22 7:42 ` Wolfram Sang
-1 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-04-22 7:42 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Heiko Stuebner, Doug Anderson, Addy Ke, Max Schwarz,
Alexandru M Stan,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 454 bytes --]
On Mon, Apr 20, 2015 at 03:14:47PM -0700, Dmitry Torokhov wrote:
> master_xfer() method should return number of i2c messages transferred,
> but on Rockchip we were usually returning just 1, which caused trouble
> with users that actually check number of transferred messages vs.
> checking for negative error codes.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Applied to for-current, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] i2c: rk3x: report number of messages transmitted
@ 2015-04-22 7:42 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-04-22 7:42 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: Heiko Stuebner, Doug Anderson, Addy Ke, Max Schwarz,
Alexandru M Stan, linux-arm-kernel, linux-rockchip, linux-i2c,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 424 bytes --]
On Mon, Apr 20, 2015 at 03:14:47PM -0700, Dmitry Torokhov wrote:
> master_xfer() method should return number of i2c messages transferred,
> but on Rockchip we were usually returning just 1, which caused trouble
> with users that actually check number of transferred messages vs.
> checking for negative error codes.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Applied to for-current, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] i2c: rk3x: report number of messages transmitted
@ 2015-04-22 7:42 ` Wolfram Sang
0 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2015-04-22 7:42 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Apr 20, 2015 at 03:14:47PM -0700, Dmitry Torokhov wrote:
> master_xfer() method should return number of i2c messages transferred,
> but on Rockchip we were usually returning just 1, which caused trouble
> with users that actually check number of transferred messages vs.
> checking for negative error codes.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Applied to for-current, thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150422/7b2fe6a9/attachment.sig>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-04-22 7:43 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 22:14 [PATCH] i2c: rk3x: report number of messages transmitted Dmitry Torokhov
2015-04-20 22:14 ` Dmitry Torokhov
2015-04-20 22:14 ` Dmitry Torokhov
2015-04-22 7:42 ` Wolfram Sang
2015-04-22 7:42 ` Wolfram Sang
2015-04-22 7:42 ` 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.