Re: [PATCH v1 2/4] ASoC: Intel: bytcr_rt5640: Use temporary variable for struct device

From: Joe Perches
Date: Wed Oct 06 2021 - 11:21:09 EST


On Wed, 2021-10-06 at 18:04 +0300, Andy Shevchenko wrote:
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

trivia:

Some will complain about a lack of commit message.

> diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
[]
> @@ -1536,7 +1536,7 @@ static int snd_byt_rt5640_mc_probe(struct platform_device *pdev)
>   put_device(&adev->dev);
>   byt_rt5640_dais[dai_index].codecs->name = byt_rt5640_codec_name;
>   } else {
> - dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id);
> + dev_err(dev, "Error cannot find '%s' dev\n", mach->id);
>   return -ENXIO;
>   }

And code that does

if (foo) {
[code...]
} else {
log_msg();
return -ERR;
}

should generally have its test reversed and use an unindented block.

if (!foo) {
log_msg();
return -ERR;
}
[code...];