Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7350a03 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 0691b40e
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -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_nvm);
	device_remove_file(&client->dev, &dev_attr_ident);
	device_remove_file(&client->dev, &dev_attr_ident);

	smiapp_free_controls(sensor);
}
}


static int smiapp_init(struct smiapp_sensor *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;
		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++) {
	for (i = 0; i < sensor->ssds_used; i++) {
		v4l2_device_unregister_subdev(&sensor->ssds[i].sd);
		v4l2_device_unregister_subdev(&sensor->ssds[i].sd);
		media_entity_cleanup(&sensor->ssds[i].sd.entity);
		media_entity_cleanup(&sensor->ssds[i].sd.entity);
	}
	}
	smiapp_free_controls(sensor);
	smiapp_cleanup(sensor);


	return 0;
	return 0;
}
}