--- zzzz-none-000/linux-3.10.107/drivers/media/i2c/bt819.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/i2c/bt819.c 2021-02-04 17:41:59.000000000 +0000 @@ -36,7 +36,6 @@ #include #include #include -#include #include #include @@ -57,7 +56,6 @@ unsigned char reg[32]; v4l2_std_id norm; - int ident; int input; int enable; }; @@ -217,15 +215,17 @@ struct bt819 *decoder = to_bt819(sd); int status = bt819_read(decoder, 0x00); int res = V4L2_IN_ST_NO_SIGNAL; - v4l2_std_id std; + v4l2_std_id std = pstd ? *pstd : V4L2_STD_ALL; if ((status & 0x80)) res = 0; + else + std = V4L2_STD_UNKNOWN; if ((status & 0x10)) - std = V4L2_STD_PAL; + std &= V4L2_STD_PAL; else - std = V4L2_STD_NTSC; + std &= V4L2_STD_NTSC; if (pstd) *pstd = std; if (pstatus) @@ -373,33 +373,14 @@ return 0; } -static int bt819_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) -{ - struct bt819 *decoder = to_bt819(sd); - struct i2c_client *client = v4l2_get_subdevdata(sd); - - return v4l2_chip_ident_i2c_client(client, chip, decoder->ident, 0); -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_ctrl_ops bt819_ctrl_ops = { .s_ctrl = bt819_s_ctrl, }; -static const struct v4l2_subdev_core_ops bt819_core_ops = { - .g_chip_ident = bt819_g_chip_ident, - .g_ext_ctrls = v4l2_subdev_g_ext_ctrls, - .try_ext_ctrls = v4l2_subdev_try_ext_ctrls, - .s_ext_ctrls = v4l2_subdev_s_ext_ctrls, - .g_ctrl = v4l2_subdev_g_ctrl, - .s_ctrl = v4l2_subdev_s_ctrl, - .queryctrl = v4l2_subdev_queryctrl, - .querymenu = v4l2_subdev_querymenu, - .s_std = bt819_s_std, -}; - static const struct v4l2_subdev_video_ops bt819_video_ops = { + .s_std = bt819_s_std, .s_routing = bt819_s_routing, .s_stream = bt819_s_stream, .querystd = bt819_querystd, @@ -407,7 +388,6 @@ }; static const struct v4l2_subdev_ops bt819_ops = { - .core = &bt819_core_ops, .video = &bt819_video_ops, }; @@ -425,7 +405,7 @@ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -ENODEV; - decoder = kzalloc(sizeof(struct bt819), GFP_KERNEL); + decoder = devm_kzalloc(&client->dev, sizeof(*decoder), GFP_KERNEL); if (decoder == NULL) return -ENOMEM; sd = &decoder->sd; @@ -435,15 +415,12 @@ switch (ver & 0xf0) { case 0x70: name = "bt819a"; - decoder->ident = V4L2_IDENT_BT819A; break; case 0x60: name = "bt817a"; - decoder->ident = V4L2_IDENT_BT817A; break; case 0x20: name = "bt815a"; - decoder->ident = V4L2_IDENT_BT815A; break; default: v4l2_dbg(1, debug, sd, @@ -476,7 +453,6 @@ int err = decoder->hdl.error; v4l2_ctrl_handler_free(&decoder->hdl); - kfree(decoder); return err; } v4l2_ctrl_handler_setup(&decoder->hdl); @@ -490,7 +466,6 @@ v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&decoder->hdl); - kfree(decoder); return 0; } @@ -506,7 +481,6 @@ static struct i2c_driver bt819_driver = { .driver = { - .owner = THIS_MODULE, .name = "bt819", }, .probe = bt819_probe,