summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2014-10-03 16:20:37 +0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-12-23 14:43:33 +0100
commitf7350a034af4531f6df7e66cd5661f0f9a0ec4d6 (patch)
treedad4675883d23f5d4186928fc2ccaa4a0f5d1b86 /drivers/media/i2c
parent[media] smiapp: Access flash capabilities through limits (diff)
downloadlinux-f7350a034af4531f6df7e66cd5661f0f9a0ec4d6.tar.xz
linux-f7350a034af4531f6df7e66cd5661f0f9a0ec4d6.zip
[media] smiapp: Free control handlers in sub-device cleanup
Also call smiapp_cleanup() in smiapp_remove(), replacing code that did the same than the function. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/smiapp/smiapp-core.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 22eddd6f92fc..d0a55fbc081c 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2522,6 +2522,8 @@ static void smiapp_cleanup(struct smiapp_sensor *sensor)
device_remove_file(&client->dev, &dev_attr_nvm);
device_remove_file(&client->dev, &dev_attr_ident);
+
+ smiapp_free_controls(sensor);
}
static int smiapp_init(struct smiapp_sensor *sensor)
@@ -3124,15 +3126,11 @@ static int smiapp_remove(struct i2c_client *client)
sensor->power_count = 0;
}
- device_remove_file(&client->dev, &dev_attr_ident);
- if (sensor->nvm)
- device_remove_file(&client->dev, &dev_attr_nvm);
-
for (i = 0; i < sensor->ssds_used; i++) {
v4l2_device_unregister_subdev(&sensor->ssds[i].sd);
media_entity_cleanup(&sensor->ssds[i].sd.entity);
}
- smiapp_free_controls(sensor);
+ smiapp_cleanup(sensor);
return 0;
}