--- zzzz-none-000/linux-3.10.107/drivers/media/i2c/wm8739.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/media/i2c/wm8739.c 2021-02-04 17:41:59.000000000 +0000 @@ -29,7 +29,6 @@ #include #include #include -#include #include MODULE_DESCRIPTION("wm8739 driver"); @@ -160,13 +159,6 @@ return 0; } -static int wm8739_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip) -{ - struct i2c_client *client = v4l2_get_subdevdata(sd); - - return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_WM8739, 0); -} - static int wm8739_log_status(struct v4l2_subdev *sd) { struct wm8739_state *state = to_state(sd); @@ -184,14 +176,6 @@ static const struct v4l2_subdev_core_ops wm8739_core_ops = { .log_status = wm8739_log_status, - .g_chip_ident = wm8739_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, }; static const struct v4l2_subdev_audio_ops wm8739_audio_ops = { @@ -220,7 +204,7 @@ v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc(sizeof(struct wm8739_state), GFP_KERNEL); + state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); if (state == NULL) return -ENOMEM; sd = &state->sd; @@ -237,7 +221,6 @@ int err = state->hdl.error; v4l2_ctrl_handler_free(&state->hdl); - kfree(state); return err; } v4l2_ctrl_cluster(3, &state->volume); @@ -271,7 +254,6 @@ v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&state->hdl); - kfree(to_state(sd)); return 0; } @@ -283,7 +265,6 @@ static struct i2c_driver wm8739_driver = { .driver = { - .owner = THIS_MODULE, .name = "wm8739", }, .probe = wm8739_probe,