* [PATCH 0/2] don't check number of I2C messages in drivers
@ 2018-05-20 6:50 Wolfram Sang
2018-05-20 6:50 ` [PATCH 2/2] i2c: opal: don't check number of messages in the driver Wolfram Sang
0 siblings, 1 reply; 5+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c; +Cc: Peter Rosin, Wolfram Sang, linux-kernel, linuxppc-dev
The core does it now, we can simplify drivers.
Wolfram Sang (2):
i2c: ibm_iic: don't check number of messages in the driver
i2c: opal: don't check number of messages in the driver
drivers/i2c/busses/i2c-ibm_iic.c | 3 ---
drivers/i2c/busses/i2c-opal.c | 4 ----
2 files changed, 7 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] i2c: opal: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/2] don't check number of I2C messages in drivers Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-24 14:13 ` Peter Rosin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linuxppc-dev, linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()") and b7f625840267 ("i2c: add quirk checks to core"), the
I2C core does this check now. We can remove it here.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/i2c/busses/i2c-opal.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
index 0aabb7eca0c5..dc2a23f4fb52 100644
--- a/drivers/i2c/busses/i2c-opal.c
+++ b/drivers/i2c/busses/i2c-opal.c
@@ -94,8 +94,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
*/
memset(&req, 0, sizeof(req));
switch(num) {
- case 0:
- return 0;
case 1:
req.type = (msgs[0].flags & I2C_M_RD) ?
OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
@@ -114,8 +112,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
req.size = cpu_to_be32(msgs[1].len);
req.buffer_ra = cpu_to_be64(__pa(msgs[1].buf));
break;
- default:
- return -EOPNOTSUPP;
}
rc = i2c_opal_send_request(opal_id, &req);
--
2.11.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] i2c: opal: don't check number of messages in the driver
2018-05-20 6:50 ` [PATCH 2/2] i2c: opal: don't check number of messages in the driver Wolfram Sang
@ 2018-05-24 14:13 ` Peter Rosin
2018-05-24 20:07 ` Wolfram Sang
2018-05-25 10:27 ` Michael Ellerman
2 siblings, 0 replies; 5+ messages in thread
From: Peter Rosin @ 2018-05-24 14:13 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
linuxppc-dev, linux-kernel
On 2018-05-20 08:50, Wolfram Sang wrote:
> Since commit 1eace8344c02 ("i2c: add param sanity check to
> i2c_transfer()") and b7f625840267 ("i2c: add quirk checks to core"), the
> I2C core does this check now. We can remove it here.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Peter Rosin <peda@axentia.se>
> ---
>
> Only build tested.
>
> drivers/i2c/busses/i2c-opal.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
> index 0aabb7eca0c5..dc2a23f4fb52 100644
> --- a/drivers/i2c/busses/i2c-opal.c
> +++ b/drivers/i2c/busses/i2c-opal.c
> @@ -94,8 +94,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> */
> memset(&req, 0, sizeof(req));
> switch(num) {
> - case 0:
> - return 0;
> case 1:
> req.type = (msgs[0].flags & I2C_M_RD) ?
> OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
> @@ -114,8 +112,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> req.size = cpu_to_be32(msgs[1].len);
> req.buffer_ra = cpu_to_be64(__pa(msgs[1].buf));
> break;
> - default:
> - return -EOPNOTSUPP;
> }
>
> rc = i2c_opal_send_request(opal_id, &req);
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] i2c: opal: don't check number of messages in the driver
2018-05-20 6:50 ` [PATCH 2/2] i2c: opal: don't check number of messages in the driver Wolfram Sang
2018-05-24 14:13 ` Peter Rosin
@ 2018-05-24 20:07 ` Wolfram Sang
2018-05-25 10:27 ` Michael Ellerman
2 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2018-05-24 20:07 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman, linuxppc-dev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
On Sun, May 20, 2018 at 08:50:34AM +0200, Wolfram Sang wrote:
> Since commit 1eace8344c02 ("i2c: add param sanity check to
> i2c_transfer()") and b7f625840267 ("i2c: add quirk checks to core"), the
> I2C core does this check now. We can remove it here.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] i2c: opal: don't check number of messages in the driver
2018-05-20 6:50 ` [PATCH 2/2] i2c: opal: don't check number of messages in the driver Wolfram Sang
2018-05-24 14:13 ` Peter Rosin
2018-05-24 20:07 ` Wolfram Sang
@ 2018-05-25 10:27 ` Michael Ellerman
2 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2018-05-25 10:27 UTC (permalink / raw)
To: Wolfram Sang, linux-i2c
Cc: Peter Rosin, Wolfram Sang, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev, linux-kernel
Wolfram Sang <wsa@the-dreams.de> writes:
> Since commit 1eace8344c02 ("i2c: add param sanity check to
> i2c_transfer()") and b7f625840267 ("i2c: add quirk checks to core"), the
> I2C core does this check now. We can remove it here.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> ---
>
> Only build tested.
It will get boot tested by me once it's in linux-next, which hopefully
is sufficient for a patch like this.
cheers
> diff --git a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
> index 0aabb7eca0c5..dc2a23f4fb52 100644
> --- a/drivers/i2c/busses/i2c-opal.c
> +++ b/drivers/i2c/busses/i2c-opal.c
> @@ -94,8 +94,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> */
> memset(&req, 0, sizeof(req));
> switch(num) {
> - case 0:
> - return 0;
> case 1:
> req.type = (msgs[0].flags & I2C_M_RD) ?
> OPAL_I2C_RAW_READ : OPAL_I2C_RAW_WRITE;
> @@ -114,8 +112,6 @@ static int i2c_opal_master_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
> req.size = cpu_to_be32(msgs[1].len);
> req.buffer_ra = cpu_to_be64(__pa(msgs[1].buf));
> break;
> - default:
> - return -EOPNOTSUPP;
> }
>
> rc = i2c_opal_send_request(opal_id, &req);
> --
> 2.11.0
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-05-25 10:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-20 6:50 [PATCH 0/2] don't check number of I2C messages in drivers Wolfram Sang
2018-05-20 6:50 ` [PATCH 2/2] i2c: opal: don't check number of messages in the driver Wolfram Sang
2018-05-24 14:13 ` Peter Rosin
2018-05-24 20:07 ` Wolfram Sang
2018-05-25 10:27 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).