--- zzzz-none-000/linux-3.10.107/drivers/media/pci/saa7146/mxb.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/pci/saa7146/mxb.c 2021-02-04 17:41:59.000000000 +0000 @@ -151,8 +151,8 @@ struct mxb { - struct video_device *video_dev; - struct video_device *vbi_dev; + struct video_device video_dev; + struct video_device vbi_dev; struct i2c_adapter i2c_adapter; @@ -357,7 +357,7 @@ tea6420_route(mxb, 6); /* select video mode in saa7111a */ - saa7111a_call(mxb, core, s_std, std); + saa7111a_call(mxb, video, s_std, std); /* select tuner-output on saa7111a */ i = 0; @@ -379,8 +379,8 @@ /* These two gpio calls set the GPIO pins that control the tda9820 */ saa7146_write(dev, GPIO_CTRL, 0x00404050); saa7111a_call(mxb, core, s_gpio, 1); - saa7111a_call(mxb, core, s_std, std); - tuner_call(mxb, core, s_std, std); + saa7111a_call(mxb, video, s_std, std); + tuner_call(mxb, video, s_std, std); /* switch to tuner-channel on tea6415c */ tea6415c_call(mxb, video, s_routing, 3, 17, 0); @@ -669,14 +669,10 @@ { struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (v4l2_chip_match_host(®->match)) { - reg->val = saa7146_read(dev, reg->reg); - reg->size = 4; - return 0; - } - call_all(dev, core, g_register, reg); + if (reg->reg > pci_resource_len(dev->pci, 0) - 4) + return -EINVAL; + reg->val = saa7146_read(dev, reg->reg); + reg->size = 4; return 0; } @@ -684,13 +680,10 @@ { struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (v4l2_chip_match_host(®->match)) { - saa7146_write(dev, reg->reg, reg->val); - return 0; - } - return call_all(dev, core, s_register, reg); + if (reg->reg > pci_resource_len(dev->pci, 0) - 4) + return -EINVAL; + saa7146_write(dev, reg->reg, reg->val); + return 0; } #endif @@ -778,9 +771,9 @@ /* These two gpio calls set the GPIO pins that control the tda9820 */ saa7146_write(dev, GPIO_CTRL, 0x00404050); saa7111a_call(mxb, core, s_gpio, 0); - saa7111a_call(mxb, core, s_std, std); + saa7111a_call(mxb, video, s_std, std); if (mxb->cur_input == 0) - tuner_call(mxb, core, s_std, std); + tuner_call(mxb, video, s_std, std); } else { v4l2_std_id std = V4L2_STD_PAL_BG; @@ -790,9 +783,9 @@ /* These two gpio calls set the GPIO pins that control the tda9820 */ saa7146_write(dev, GPIO_CTRL, 0x00404050); saa7111a_call(mxb, core, s_gpio, 1); - saa7111a_call(mxb, core, s_std, std); + saa7111a_call(mxb, video, s_std, std); if (mxb->cur_input == 0) - tuner_call(mxb, core, s_std, std); + tuner_call(mxb, video, s_std, std); } return 0; }