/* Detach and unregister the encoder. The go7007 struct won't be freed until v4l2 finishes releasing its resources and all associated fds are closed by applications.  */
void go7007_remove(struct go7007 *go)
/* Detach and unregister the encoder. The go7007 struct won't be freed until v4l2 finishes releasing its resources and all associated fds are closed by applications.  */
void go7007_remove(struct go7007 *go)
{
	if (go->i2c_adapter_online) {
		if (i2c_del_adapter(&go->i2c_adapter) == 0)
			go->i2c_adapter_online = 0;
		else
			v4l2_err(&go->v4l2_dev,
				"error removing I2C adapter!\n");
	}
	if (go->audio_enabled)
		go7007_snd_remove(go);
	go7007_v4l2_remove(go);
}