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

Commit eda1a701 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown
Browse files

ASoC: ac97: Use static ac97_bus



We always pass soc_ac97_ops to snd_soc_new_ac97_codec(). So instead of
allocating a snd_ac97_bus in snd_soc_new_ac97_codec() just use a static one
that gets initialized when snd_soc_set_ac97_ops() is called.

Also drop the device number parameter from snd_soc_new_ac97_codec(). We
currently only support one device per bus and all drivers pass 0 for the
device number. And if we should ever support multiple devices per bus it
wouldn't be up to individual AC'97 device drivers to pick their number, but
rather either the AC'97 adapter driver or the core code will assign them.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Acked-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 336b8423
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -499,8 +499,7 @@ int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned int reg,
				unsigned int mask, unsigned int value);

#ifdef CONFIG_SND_SOC_AC97_BUS
int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
	struct snd_ac97_bus_ops *ops, int num);
int snd_soc_new_ac97_codec(struct snd_soc_codec *codec);
void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);

int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
+1 −1
Original line number Diff line number Diff line
@@ -220,7 +220,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
	u16 vendor_id2;
	u16 ext_status;

	ret = snd_soc_new_ac97_codec(codec, soc_ac97_ops, 0);
	ret = snd_soc_new_ac97_codec(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to register AC97 codec\n");
		return ret;
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec)
{
	int ret = 0;

	ret = snd_soc_new_ac97_codec(codec, soc_ac97_ops, 0);
	ret = snd_soc_new_ac97_codec(codec);
	if (ret < 0)
		goto codec_err;

+1 −1
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
{
	int ret = 0;

	ret = snd_soc_new_ac97_codec(codec, soc_ac97_ops, 0);
	ret = snd_soc_new_ac97_codec(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to register AC97 codec\n");
		return ret;
+1 −1
Original line number Diff line number Diff line
@@ -666,7 +666,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
{
	int ret = 0;

	ret = snd_soc_new_ac97_codec(codec, soc_ac97_ops, 0);
	ret = snd_soc_new_ac97_codec(codec);
	if (ret < 0) {
		dev_err(codec->dev, "Failed to register AC97 codec\n");
		return ret;
Loading