lkml.org 
[lkml]   [2017]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3 v4] ASoC: hisilicon: Add hi6210 i2s audio driver
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2017-04-10 20:40    [W:0.064 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site