From c02b211df6fc54e51ee554c27a6736a11255a764 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 2 May 2013 08:29:43 -0300 Subject: [media] media: i2c: Convert to devm_kzalloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the managed function the kfree() calls can be removed from the probe error path and the remove handler. Signed-off-by: Laurent Pinchart Acked-by: Sylwester Nawrocki Acked-by: Lad, Prabhakar Acked-by: Andy Shevchenko Reviewed-by: Benoît Thébaudeau Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/saa7185.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/media/i2c/saa7185.c') diff --git a/drivers/media/i2c/saa7185.c b/drivers/media/i2c/saa7185.c index 2c6b65c..e95a0ed 100644 --- a/drivers/media/i2c/saa7185.c +++ b/drivers/media/i2c/saa7185.c @@ -326,7 +326,7 @@ static int saa7185_probe(struct i2c_client *client, v4l_info(client, "chip found @ 0x%x (%s)\n", client->addr << 1, client->adapter->name); - encoder = kzalloc(sizeof(struct saa7185), GFP_KERNEL); + encoder = devm_kzalloc(&client->dev, sizeof(*encoder), GFP_KERNEL); if (encoder == NULL) return -ENOMEM; encoder->norm = V4L2_STD_NTSC; @@ -352,7 +352,6 @@ static int saa7185_remove(struct i2c_client *client) v4l2_device_unregister_subdev(sd); /* SW: output off is active */ saa7185_write(sd, 0x61, (encoder->reg[0x61]) | 0x40); - kfree(encoder); return 0; } -- cgit v1.1 From e12771100c93e101a7a8b302b6c5d57cff7b1551 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 29 May 2013 06:59:51 -0300 Subject: [media] media/i2c: remove g_chip_ident op This is no longer needed since the core now handles this through DBG_G_CHIP_INFO. Signed-off-by: Hans Verkuil Acked-by: Laurent Pinchart Acked-by: Lad, Prabhakar Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/saa7185.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'drivers/media/i2c/saa7185.c') diff --git a/drivers/media/i2c/saa7185.c b/drivers/media/i2c/saa7185.c index e95a0ed..f56c1c8 100644 --- a/drivers/media/i2c/saa7185.c +++ b/drivers/media/i2c/saa7185.c @@ -32,7 +32,6 @@ #include #include #include -#include MODULE_DESCRIPTION("Philips SAA7185 video encoder driver"); MODULE_AUTHOR("Dave Perks"); @@ -285,17 +284,9 @@ static int saa7185_s_routing(struct v4l2_subdev *sd, return 0; } -static int saa7185_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_SAA7185, 0); -} - /* ----------------------------------------------------------------------- */ static const struct v4l2_subdev_core_ops saa7185_core_ops = { - .g_chip_ident = saa7185_g_chip_ident, .init = saa7185_init, }; -- cgit v1.1