[alsa-devel] [PATCH 096/127] ASoC: use component probe/remove on twl4030
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Aug 9 07:34:04 CEST 2016
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
codec driver and component driver has duplicated .probe/.remove
functions, and codec side is just relayed it. This was quick-hack,
but no longer needed.
This patch uses component .probe/.remove
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
sound/soc/codecs/twl4030.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index a2104d6..4e05b7f 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -2163,8 +2163,9 @@ static struct snd_soc_dai_driver twl4030_dai[] = {
},
};
-static int twl4030_soc_probe(struct snd_soc_codec *codec)
+static int twl4030_soc_probe(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct twl4030_priv *twl4030;
twl4030 = devm_kzalloc(codec->dev, sizeof(struct twl4030_priv),
@@ -2180,26 +2181,25 @@ static int twl4030_soc_probe(struct snd_soc_codec *codec)
return 0;
}
-static int twl4030_soc_remove(struct snd_soc_codec *codec)
+static void twl4030_soc_remove(struct snd_soc_component *component)
{
+ struct snd_soc_codec *codec = snd_soc_component_to_codec(component);
struct twl4030_priv *twl4030 = snd_soc_codec_get_drvdata(codec);
struct twl4030_codec_data *pdata = twl4030->pdata;
if (pdata && pdata->hs_extmute && gpio_is_valid(pdata->hs_extmute_gpio))
gpio_free(pdata->hs_extmute_gpio);
-
- return 0;
}
static struct snd_soc_codec_driver soc_codec_dev_twl4030 = {
- .probe = twl4030_soc_probe,
- .remove = twl4030_soc_remove,
.read = twl4030_read,
.write = twl4030_write,
.set_bias_level = twl4030_set_bias_level,
.idle_bias_off = true,
.component_driver = {
+ .probe = twl4030_soc_probe,
+ .remove = twl4030_soc_remove,
.controls = twl4030_snd_controls,
.num_controls = ARRAY_SIZE(twl4030_snd_controls),
.dapm_widgets = twl4030_dapm_widgets,
--
1.9.1
More information about the Alsa-devel
mailing list