summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-04-17 15:03:34 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-25 09:33:42 -0300
commit0c2224ee0e480001eab6fd31e7d12b6d80745926 (patch)
tree9472818f6e3c08a0aa4f1f5d26a4130728aa347f /drivers
parent068b16b638070611272cf60da821cd70b2a267b3 (diff)
[media] s5c73m3: Fix remove() callback to free requested resources
Make sure v4l2_device_unregister_subdev() is called for both: oif and sensor subdev and both media entities are freed on driver removal. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/i2c/s5c73m3/s5c73m3-core.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/media/i2c/s5c73m3/s5c73m3-core.c b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
index b353c50a688..ce8fcf22253 100644
--- a/drivers/media/i2c/s5c73m3/s5c73m3-core.c
+++ b/drivers/media/i2c/s5c73m3/s5c73m3-core.c
@@ -1668,13 +1668,17 @@ out_err1:
static int s5c73m3_remove(struct i2c_client *client)
{
- struct v4l2_subdev *sd = i2c_get_clientdata(client);
- struct s5c73m3 *state = sensor_sd_to_s5c73m3(sd);
+ struct v4l2_subdev *oif_sd = i2c_get_clientdata(client);
+ struct s5c73m3 *state = oif_sd_to_s5c73m3(oif_sd);
+ struct v4l2_subdev *sensor_sd = &state->sensor_sd;
- v4l2_device_unregister_subdev(sd);
+ v4l2_device_unregister_subdev(oif_sd);
- v4l2_ctrl_handler_free(sd->ctrl_handler);
- media_entity_cleanup(&sd->entity);
+ v4l2_ctrl_handler_free(oif_sd->ctrl_handler);
+ media_entity_cleanup(&oif_sd->entity);
+
+ v4l2_device_unregister_subdev(sensor_sd);
+ media_entity_cleanup(&sensor_sd->entity);
s5c73m3_unregister_spi_driver(state);
s5c73m3_free_gpios(state);