Commit b3c4014c authored by Takashi Iwai's avatar Takashi Iwai
Browse files

Merge tag 'asoc-fix-v5.0-rc2' of...

Merge tag 'asoc-fix-v5.0-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus

ASoC: Fixes for v5.0

Quite a big batch of fixes here.  There's a couple of things going on,
the main one is that we found some issues with not deferring probe when
we should, causing us to skip some driver initialization.  The fixes for
this then in turn exposed some issues with how we were searching for
components which had previously gone unnoticed due to the original
issue.

There's also been the normal driver specific stuff and there's been what
looks like several batches of automated scanning for issues which have
generated quite a large set of smaller fixes for potential crashes and
missed error handling.
parents 687ae9e2 4cb79ef9
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -985,6 +985,12 @@ struct snd_soc_dai_link {
	/* Do not create a PCM for this DAI link (Backend link) */
	unsigned int ignore:1;

	/*
	 * This driver uses legacy platform naming. Set by the core, machine
	 * drivers should not modify this value.
	 */
	unsigned int legacy_platform:1;

	struct list_head list; /* DAI link list of the soc card */
	struct snd_soc_dobj dobj; /* For topology */
};
+2 −1
Original line number Diff line number Diff line
@@ -541,7 +541,8 @@ static int snd_compress_check_input(struct snd_compr_params *params)
{
	/* first let's check the buffer parameter's */
	if (params->buffer.fragment_size == 0 ||
	    params->buffer.fragments > INT_MAX / params->buffer.fragment_size)
	    params->buffer.fragments > INT_MAX / params->buffer.fragment_size ||
	    params->buffer.fragments == 0)
		return -EINVAL;

	/* now codec parameters */
+4 −2
Original line number Diff line number Diff line
@@ -611,14 +611,16 @@ static int acp3x_audio_probe(struct platform_device *pdev)
	}
	irqflags = *((unsigned int *)(pdev->dev.platform_data));

	adata = devm_kzalloc(&pdev->dev, sizeof(struct i2s_dev_data),
			     GFP_KERNEL);
	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (!res) {
		dev_err(&pdev->dev, "IORESOURCE_IRQ FAILED\n");
			return -ENODEV;
	}

	adata = devm_kzalloc(&pdev->dev, sizeof(*adata), GFP_KERNEL);
	if (!adata)
		return -ENOMEM;

	adata->acp3x_base = devm_ioremap(&pdev->dev, res->start,
					 resource_size(res));

+4 −7
Original line number Diff line number Diff line
@@ -1400,24 +1400,20 @@ static int pcm512x_digital_mute(struct snd_soc_dai *dai, int mute)
		if (ret != 0) {
			dev_err(component->dev,
				"Failed to set digital mute: %d\n", ret);
			mutex_unlock(&pcm512x->mutex);
			return ret;
			goto unlock;
		}

		regmap_read_poll_timeout(pcm512x->regmap,
					 PCM512x_ANALOG_MUTE_DET,
					 mute_det, (mute_det & 0x3) == 0,
					 200, 10000);

		mutex_unlock(&pcm512x->mutex);
	} else {
		pcm512x->mute &= ~0x1;
		ret = pcm512x_update_mute(pcm512x);
		if (ret != 0) {
			dev_err(component->dev,
				"Failed to update digital mute: %d\n", ret);
			mutex_unlock(&pcm512x->mutex);
			return ret;
			goto unlock;
		}

		regmap_read_poll_timeout(pcm512x->regmap,
@@ -1428,9 +1424,10 @@ static int pcm512x_digital_mute(struct snd_soc_dai *dai, int mute)
					 200, 10000);
	}

unlock:
	mutex_unlock(&pcm512x->mutex);

	return 0;
	return ret;
}

static const struct snd_soc_dai_ops pcm512x_dai_ops = {
+4 −1
Original line number Diff line number Diff line
@@ -1128,8 +1128,11 @@ static int rt274_i2c_probe(struct i2c_client *i2c,
		return ret;
	}

	regmap_read(rt274->regmap,
	ret = regmap_read(rt274->regmap,
		RT274_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val);
	if (ret)
		return ret;

	if (val != RT274_VENDOR_ID) {
		dev_err(&i2c->dev,
			"Device with ID register %#x is not rt274\n", val);
Loading