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

Commit e0c42118 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: rcar: remove rsnd_kctrl_remove()



Current rcar driver is trying to remove kctrl when remove time.
But, 1) rcar driver can't/shouldn't remove before removing sound
card driver, 2) sound card driver will call snd_ctl_dev_free()
and removes all kctrls by snd_ctl_remove().
Thus, rsnd_kctrl_remove() is not necessary. Current implementation
will get Oops when removing rcar driver after sound card.
This patch fix this issue.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6b8530cc
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -1039,15 +1039,6 @@ static int __rsnd_kctrl_new(struct rsnd_mod *mod,
	return 0;
	return 0;
}
}


void _rsnd_kctrl_remove(struct rsnd_kctrl_cfg *cfg)
{
	if (cfg->card && cfg->kctrl)
		snd_ctl_remove(cfg->card, cfg->kctrl);

	cfg->card = NULL;
	cfg->kctrl = NULL;
}

int rsnd_kctrl_new_m(struct rsnd_mod *mod,
int rsnd_kctrl_new_m(struct rsnd_mod *mod,
		     struct rsnd_dai_stream *io,
		     struct rsnd_dai_stream *io,
		     struct snd_soc_pcm_runtime *rtd,
		     struct snd_soc_pcm_runtime *rtd,
+0 −16
Original line number Original line Diff line number Diff line
@@ -218,21 +218,6 @@ static int rsnd_dvc_probe_(struct rsnd_mod *mod,
	return rsnd_cmd_attach(io, rsnd_mod_id(mod));
	return rsnd_cmd_attach(io, rsnd_mod_id(mod));
}
}


static int rsnd_dvc_remove_(struct rsnd_mod *mod,
			    struct rsnd_dai_stream *io,
			    struct rsnd_priv *priv)
{
	struct rsnd_dvc *dvc = rsnd_mod_to_dvc(mod);

	rsnd_kctrl_remove(dvc->volume);
	rsnd_kctrl_remove(dvc->mute);
	rsnd_kctrl_remove(dvc->ren);
	rsnd_kctrl_remove(dvc->rup);
	rsnd_kctrl_remove(dvc->rdown);

	return 0;
}

static int rsnd_dvc_init(struct rsnd_mod *mod,
static int rsnd_dvc_init(struct rsnd_mod *mod,
			 struct rsnd_dai_stream *io,
			 struct rsnd_dai_stream *io,
			 struct rsnd_priv *priv)
			 struct rsnd_priv *priv)
@@ -332,7 +317,6 @@ static struct rsnd_mod_ops rsnd_dvc_ops = {
	.name		= DVC_NAME,
	.name		= DVC_NAME,
	.dma_req	= rsnd_dvc_dma_req,
	.dma_req	= rsnd_dvc_dma_req,
	.probe		= rsnd_dvc_probe_,
	.probe		= rsnd_dvc_probe_,
	.remove		= rsnd_dvc_remove_,
	.init		= rsnd_dvc_init,
	.init		= rsnd_dvc_init,
	.quit		= rsnd_dvc_quit,
	.quit		= rsnd_dvc_quit,
	.pcm_new	= rsnd_dvc_pcm_new,
	.pcm_new	= rsnd_dvc_pcm_new,
+0 −3
Original line number Original line Diff line number Diff line
@@ -611,9 +611,6 @@ struct rsnd_kctrl_cfg_s {
	u32 val;
	u32 val;
};
};


void _rsnd_kctrl_remove(struct rsnd_kctrl_cfg *cfg);
#define rsnd_kctrl_remove(_cfg)	_rsnd_kctrl_remove(&((_cfg).cfg))

int rsnd_kctrl_new_m(struct rsnd_mod *mod,
int rsnd_kctrl_new_m(struct rsnd_mod *mod,
		     struct rsnd_dai_stream *io,
		     struct rsnd_dai_stream *io,
		     struct snd_soc_pcm_runtime *rtd,
		     struct snd_soc_pcm_runtime *rtd,