diff options
Diffstat (limited to 'drivers/media/i2c/adv7393.c')
-rw-r--r-- | drivers/media/i2c/adv7393.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/media/i2c/adv7393.c b/drivers/media/i2c/adv7393.c index 3dc6098c726..558f19154eb 100644 --- a/drivers/media/i2c/adv7393.c +++ b/drivers/media/i2c/adv7393.c @@ -33,7 +33,6 @@ #include <media/adv7393.h> #include <media/v4l2-device.h> -#include <media/v4l2-chip-ident.h> #include <media/v4l2-ctrls.h> #include "adv7393_regs.h" @@ -301,21 +300,12 @@ static int adv7393_s_ctrl(struct v4l2_ctrl *ctrl) return -EINVAL; } -static int adv7393_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_ADV7393, 0); -} - static const struct v4l2_ctrl_ops adv7393_ctrl_ops = { .s_ctrl = adv7393_s_ctrl, }; static const struct v4l2_subdev_core_ops adv7393_core_ops = { .log_status = adv7393_log_status, - .g_chip_ident = adv7393_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, @@ -410,7 +400,7 @@ static int adv7393_probe(struct i2c_client *client, v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - state = kzalloc(sizeof(struct adv7393_state), GFP_KERNEL); + state = devm_kzalloc(&client->dev, sizeof(*state), GFP_KERNEL); if (state == NULL) return -ENOMEM; @@ -444,16 +434,13 @@ static int adv7393_probe(struct i2c_client *client, int err = state->hdl.error; v4l2_ctrl_handler_free(&state->hdl); - kfree(state); return err; } v4l2_ctrl_handler_setup(&state->hdl); err = adv7393_initialize(&state->sd); - if (err) { + if (err) v4l2_ctrl_handler_free(&state->hdl); - kfree(state); - } return err; } @@ -464,7 +451,6 @@ static int adv7393_remove(struct i2c_client *client) v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&state->hdl); - kfree(state); return 0; } |