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

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

ASoC: Move name and id from CODEC/platform to component



The component struct already has a name and id field which are initialized to
the same values as the same fields in the CODEC and platform structs. So remove
them from the CODEC and platform structs and used the ones from the component
struct instead.

Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 94f99c87
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -710,8 +710,6 @@ struct snd_soc_component {

/* SoC Audio Codec device */
struct snd_soc_codec {
	const char *name;
	int id;
	struct device *dev;
	const struct snd_soc_codec_driver *driver;

@@ -848,8 +846,6 @@ struct snd_soc_platform_driver {
};

struct snd_soc_platform {
	const char *name;
	int id;
	struct device *dev;
	const struct snd_soc_platform_driver *driver;

+3 −3
Original line number Diff line number Diff line
@@ -296,17 +296,17 @@ TRACE_EVENT(snd_soc_cache_sync,
	TP_ARGS(codec, type, status),

	TP_STRUCT__entry(
		__string(	name,		codec->name	)
		__string(	name,		codec->component.name)
		__string(	status,		status		)
		__string(	type,		type		)
		__field(	int,		id		)
	),

	TP_fast_assign(
		__assign_str(name, codec->name);
		__assign_str(name, codec->component.name);
		__assign_str(status, status);
		__assign_str(type, type);
		__entry->id = codec->id;
		__entry->id = codec->component.id;
	),

	TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
+1 −1
Original line number Diff line number Diff line
@@ -1404,7 +1404,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
	if (dac33->irq >= 0) {
		ret = request_irq(dac33->irq, dac33_interrupt_handler,
				  IRQF_TRIGGER_RISING,
				  codec->name, codec);
				  codec->component.name, codec);
		if (ret < 0) {
			dev_err(codec->dev, "Could not request IRQ%d (%d)\n",
						dac33->irq, ret);
+3 −4
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
	mutex_init(&codec->cache_rw_mutex);

	dev_dbg(codec->dev, "ASoC: Initializing cache for %s codec\n",
				codec->name);
				codec->component.name);

	if (codec_drv->reg_cache_default)
		codec->reg_cache = kmemdup(codec_drv->reg_cache_default,
@@ -98,8 +98,7 @@ int snd_soc_cache_init(struct snd_soc_codec *codec)
int snd_soc_cache_exit(struct snd_soc_codec *codec)
{
	dev_dbg(codec->dev, "ASoC: Destroying cache for %s codec\n",
			codec->name);

			codec->component.name);
	kfree(codec->reg_cache);
	codec->reg_cache = NULL;
	return 0;
@@ -192,7 +191,7 @@ int snd_soc_cache_sync(struct snd_soc_codec *codec)
		return 0;

	dev_dbg(codec->dev, "ASoC: Syncing cache for %s codec\n",
		codec->name);
		codec->component.name);
	trace_snd_soc_cache_sync(codec, name, "start");
	ret = snd_soc_flat_cache_sync(codec);
	if (!ret)
+5 −3
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ static int soc_compr_open(struct snd_compr_stream *cstream)
	if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
		ret = platform->driver->compr_ops->open(cstream);
		if (ret < 0) {
			pr_err("compress asoc: can't open platform %s\n", platform->name);
			pr_err("compress asoc: can't open platform %s\n",
				platform->component.name);
			goto out;
		}
	}
@@ -84,7 +85,8 @@ static int soc_compr_open_fe(struct snd_compr_stream *cstream)
	if (platform->driver->compr_ops && platform->driver->compr_ops->open) {
		ret = platform->driver->compr_ops->open(cstream);
		if (ret < 0) {
			pr_err("compress asoc: can't open platform %s\n", platform->name);
			pr_err("compress asoc: can't open platform %s\n",
				platform->component.name);
			goto out;
		}
	}
@@ -680,7 +682,7 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
	ret = snd_compress_new(rtd->card->snd_card, num, direction, compr);
	if (ret < 0) {
		pr_err("compress asoc: can't create compress for codec %s\n",
			codec->name);
			codec->component.name);
		goto compr_err;
	}

Loading