1
0
mirror of https://github.com/DigitalDevices/dddvb.git synced 2023-10-10 13:37:43 +02:00

use correct i2c num entry

This commit is contained in:
Ralph Metzler 2019-04-12 20:11:27 +02:00
parent 4783d0eab2
commit 0248e43bc7

View File

@ -3495,9 +3495,11 @@ static long ddb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct i2c_adapter *adap; struct i2c_adapter *adap;
u8 *mbuf, *hbuf = &dev->iobuf[0]; u8 *mbuf, *hbuf = &dev->iobuf[0];
if (!dev->link[0].info->regmap->i2c)
return -EINVAL;
if (copy_from_user(&i2c, parg, sizeof(i2c))) if (copy_from_user(&i2c, parg, sizeof(i2c)))
return -EFAULT; return -EFAULT;
if (i2c.bus > dev->link[0].info->regmap->i2c->num) if (i2c.bus > dev->i2c_num)
return -EINVAL; return -EINVAL;
if (i2c.mlen + i2c.hlen > 512) if (i2c.mlen + i2c.hlen > 512)
return -EINVAL; return -EINVAL;
@ -3521,7 +3523,7 @@ static long ddb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (copy_from_user(&i2c, parg, sizeof(i2c))) if (copy_from_user(&i2c, parg, sizeof(i2c)))
return -EFAULT; return -EFAULT;
if (i2c.bus > dev->link[0].info->regmap->i2c->num) if (i2c.bus > dev->i2c_num)
return -EINVAL; return -EINVAL;
if (i2c.mlen + i2c.hlen > 250) if (i2c.mlen + i2c.hlen > 250)
return -EINVAL; return -EINVAL;