From: Hans de Goede Date: Sun, 4 Mar 2018 14:35:58 +0000 (+0100) Subject: ASoC: Intel: bytcr_rt5651: Not being able to find the codec ACPI-dev is an error X-Git-Tag: v4.19~773^2~32^2~42^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e39cacc1b7de2a6d72ce49043c9cfd7dd129135a;p=platform%2Fkernel%2Flinux-rpi3.git ASoC: Intel: bytcr_rt5651: Not being able to find the codec ACPI-dev is an error If we cannot find the codec ACPI-dev, then the snd-soc-core will not be able to find the codec either and snd_soc_register_card() will just keep exiting with -EPROBE_DEFER, filling the log with errors each time the probe gets retried. Instead simply log an error from the machine driver and exit with -ENODEV. Signed-off-by: Hans de Goede Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index 456526a..105339c 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c @@ -540,12 +540,13 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) /* fixup codec name based on HID */ i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); - if (i2c_name) { - snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), - "%s%s", "i2c-", i2c_name); - - byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; + if (!i2c_name) { + dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); + return -ENODEV; } + snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), + "%s%s", "i2c-", i2c_name); + byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; /* check quirks before creating card */ dmi_check_system(byt_rt5651_quirk_table);