[media] smiapp: Free control handlers in sub-device cleanup
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 3 Oct 2014 14:20:37 +0000 (11:20 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 13:43:33 +0000 (11:43 -0200)
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>
drivers/media/i2c/smiapp/smiapp-core.c

index 22eddd6f92fc35fa39c7750037138a3d867014d7..d0a55fbc081cbcdbc82a4edb931b7f63f718a3f0 100644 (file)
@@ -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;
 }