* [PATCH 0/7] don't check number of I2C messages in drivers
@ 2018-05-20 6:50 Wolfram Sang
2018-05-20 6:50 ` [PATCH 1/7] media: netup_unidvb: don't check number of messages in the driver Wolfram Sang
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c; +Cc: Peter Rosin, Wolfram Sang, linux-kernel, linux-media
The core does it now, we can simplify drivers.
Based on v4.17-rc5. buildbot is happy. I'd suggest the media tree.
Thanks,
Wolfram
Wolfram Sang (7):
media: netup_unidvb: don't check number of messages in the driver
media: si4713: don't check number of messages in the driver
media: cx231xx: don't check number of messages in the driver
media: em28xx: don't check number of messages in the driver
media: hdpvr: don't check number of messages in the driver
media: tm6000: don't check number of messages in the driver
media: dvb-usb: don't check number of messages in the driver
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 5 -----
drivers/media/radio/si4713/radio-usb-si4713.c | 3 ---
drivers/media/usb/cx231xx/cx231xx-i2c.c | 2 --
drivers/media/usb/dvb-usb/m920x.c | 3 ---
drivers/media/usb/em28xx/em28xx-i2c.c | 4 ----
drivers/media/usb/hdpvr/hdpvr-i2c.c | 3 ---
drivers/media/usb/tm6000/tm6000-i2c.c | 2 --
7 files changed, 22 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/7] media: netup_unidvb: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 2/7] media: si4713: " Wolfram Sang
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Sergey Kozlov, Abylay Ospan,
Mauro Carvalho Chehab, linux-media, linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
index b13e319d24b7..5f1613aec93c 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_i2c.c
@@ -214,11 +214,6 @@ static int netup_i2c_xfer(struct i2c_adapter *adap,
struct netup_i2c *i2c = i2c_get_adapdata(adap);
u16 reg;
- if (num <= 0) {
- dev_dbg(i2c->adap.dev.parent,
- "%s(): num == %d\n", __func__, num);
- return -EINVAL;
- }
spin_lock_irqsave(&i2c->lock, flags);
if (i2c->state != STATE_DONE) {
dev_dbg(i2c->adap.dev.parent,
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/7] media: si4713: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
2018-05-20 6:50 ` [PATCH 1/7] media: netup_unidvb: don't check number of messages in the driver Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 3/7] media: cx231xx: " Wolfram Sang
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Hans Verkuil, Mauro Carvalho Chehab,
linux-media, linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/radio/si4713/radio-usb-si4713.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/media/radio/si4713/radio-usb-si4713.c b/drivers/media/radio/si4713/radio-usb-si4713.c
index 05c66701a899..1ebbf0217142 100644
--- a/drivers/media/radio/si4713/radio-usb-si4713.c
+++ b/drivers/media/radio/si4713/radio-usb-si4713.c
@@ -370,9 +370,6 @@ static int si4713_transfer(struct i2c_adapter *i2c_adapter,
int retval = -EINVAL;
int i;
- if (num <= 0)
- return 0;
-
for (i = 0; i < num; i++) {
if (msgs[i].flags & I2C_M_RD)
retval = si4713_i2c_read(radio, msgs[i].buf, msgs[i].len);
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/7] media: cx231xx: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
2018-05-20 6:50 ` [PATCH 1/7] media: netup_unidvb: don't check number of messages in the driver Wolfram Sang
2018-05-20 6:50 ` [PATCH 2/7] media: si4713: " Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 4/7] media: em28xx: " Wolfram Sang
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Mauro Carvalho Chehab, linux-media,
linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/usb/cx231xx/cx231xx-i2c.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/media/usb/cx231xx/cx231xx-i2c.c b/drivers/media/usb/cx231xx/cx231xx-i2c.c
index 6e1bef2a45bb..15a91169e749 100644
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -376,8 +376,6 @@ static int cx231xx_i2c_xfer(struct i2c_adapter *i2c_adap,
struct cx231xx *dev = bus->dev;
int addr, rc, i, byte;
- if (num <= 0)
- return 0;
mutex_lock(&dev->i2c_lock);
for (i = 0; i < num; i++) {
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/7] media: em28xx: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
` (2 preceding siblings ...)
2018-05-20 6:50 ` [PATCH 3/7] media: cx231xx: " Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 5/7] media: hdpvr: " Wolfram Sang
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Mauro Carvalho Chehab, linux-media,
linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/usb/em28xx/em28xx-i2c.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
index 6458682bc6e2..e19d6342e0d0 100644
--- a/drivers/media/usb/em28xx/em28xx-i2c.c
+++ b/drivers/media/usb/em28xx/em28xx-i2c.c
@@ -559,10 +559,6 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
dev->cur_i2c_bus = bus;
}
- if (num <= 0) {
- rt_mutex_unlock(&dev->i2c_bus_lock);
- return 0;
- }
for (i = 0; i < num; i++) {
addr = msgs[i].addr << 1;
if (!msgs[i].len) {
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/7] media: hdpvr: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
` (3 preceding siblings ...)
2018-05-20 6:50 ` [PATCH 4/7] media: em28xx: " Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 6/7] media: tm6000: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 7/7] media: dvb-usb: " Wolfram Sang
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Hans Verkuil, Mauro Carvalho Chehab,
linux-media, linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/usb/hdpvr/hdpvr-i2c.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c
index 4720d79b0282..c97dcf981b3f 100644
--- a/drivers/media/usb/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c
@@ -117,9 +117,6 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
struct hdpvr_device *dev = i2c_get_adapdata(i2c_adapter);
int retval = 0, addr;
- if (num <= 0)
- return 0;
-
mutex_lock(&dev->i2c_mutex);
addr = msgs[0].addr << 1;
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 6/7] media: tm6000: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
` (4 preceding siblings ...)
2018-05-20 6:50 ` [PATCH 5/7] media: hdpvr: " Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
2018-05-20 6:50 ` [PATCH 7/7] media: dvb-usb: " Wolfram Sang
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Mauro Carvalho Chehab, linux-media,
linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/usb/tm6000/tm6000-i2c.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/media/usb/tm6000/tm6000-i2c.c b/drivers/media/usb/tm6000/tm6000-i2c.c
index 659b63febf85..ccd1adf862b1 100644
--- a/drivers/media/usb/tm6000/tm6000-i2c.c
+++ b/drivers/media/usb/tm6000/tm6000-i2c.c
@@ -145,8 +145,6 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
struct tm6000_core *dev = i2c_adap->algo_data;
int addr, rc, i, byte;
- if (num <= 0)
- return 0;
for (i = 0; i < num; i++) {
addr = (msgs[i].addr << 1) & 0xff;
i2c_dprintk(2, "%s %s addr=0x%x len=%d:",
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 7/7] media: dvb-usb: don't check number of messages in the driver
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
` (5 preceding siblings ...)
2018-05-20 6:50 ` [PATCH 6/7] media: tm6000: " Wolfram Sang
@ 2018-05-20 6:50 ` Wolfram Sang
6 siblings, 0 replies; 8+ messages in thread
From: Wolfram Sang @ 2018-05-20 6:50 UTC (permalink / raw)
To: linux-i2c
Cc: Peter Rosin, Wolfram Sang, Mauro Carvalho Chehab, linux-media,
linux-kernel
Since commit 1eace8344c02 ("i2c: add param sanity check to
i2c_transfer()"), the I2C core does this check now. We can remove it
from drivers.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Only build tested.
drivers/media/usb/dvb-usb/m920x.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c
index 32081c2ce0da..a6ab6688cbb3 100644
--- a/drivers/media/usb/dvb-usb/m920x.c
+++ b/drivers/media/usb/dvb-usb/m920x.c
@@ -255,9 +255,6 @@ static int m920x_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int nu
int i, j;
int ret = 0;
- if (!num)
- return -EINVAL;
-
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
return -EAGAIN;
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2018-05-20 6:52 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-20 6:50 [PATCH 0/7] don't check number of I2C messages in drivers Wolfram Sang
2018-05-20 6:50 ` [PATCH 1/7] media: netup_unidvb: don't check number of messages in the driver Wolfram Sang
2018-05-20 6:50 ` [PATCH 2/7] media: si4713: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 3/7] media: cx231xx: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 4/7] media: em28xx: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 5/7] media: hdpvr: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 6/7] media: tm6000: " Wolfram Sang
2018-05-20 6:50 ` [PATCH 7/7] media: dvb-usb: " Wolfram Sang
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).