Re: [PATCH 2/3 v4] ASoC: hisilicon: Add hi6210 i2s audio driver

From: Mark Brown
Date: Mon Apr 10 2017 - 14:40:00 EST


On Fri, Mar 31, 2017 at 03:06:00PM -0700, John Stultz wrote:

Looks mostly good, a few more minor issues, please send incremental
fixes for these:

> +
> + switch (i2s->format & SND_SOC_DAIFMT_MASTER_MASK) {

> + default:
> + WARN_ONCE(1, "Invalid i2s->fmt MASTER_MASK. This shouldn't happen\n");
> + }

It should still return an error just in case.

> + switch (i2s->format & SND_SOC_DAIFMT_FORMAT_MASK) {

> + default:
> + WARN_ONCE(1, "Invalid i2s->fmt FORMAT_MASK. This shouldn't happen\n");
> + }

Similarly.

> + default:
> + val = hi6210_read_reg(i2s, HII2S_I2S_CFG);
> + val &= ~HII2S_I2S_CFG__S2_FRAME_MODE;
> + hi6210_write_reg(i2s, HII2S_I2S_CFG, val);
> + }

Missing break.

> + ret = snd_soc_register_component(&pdev->dev, &hi6210_i2s_i2s_comp,
> + &i2s->dai, 1);
> + if (ret) {
> + dev_err(&pdev->dev, "Failed to register dai\n");
> + return ret;
> + }

devm_snd_soc_register_component()

> +static int hi6210_i2s_remove(struct platform_device *pdev)
> +{
> + snd_soc_unregister_component(&pdev->dev);
> + dev_set_drvdata(&pdev->dev, NULL);

The core will set the driver data to NULL, though it shouldn't be
needed.

Attachment: signature.asc
Description: PGP signature