diff options
| -rw-r--r-- | sound/soc/intel/boards/bytcr_rt5651.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c index b0a4d297176e..b744add01d12 100644 --- a/sound/soc/intel/boards/bytcr_rt5651.c +++ b/sound/soc/intel/boards/bytcr_rt5651.c | |||
| @@ -867,8 +867,8 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) | |||
| 867 | struct byt_rt5651_private *priv; | 867 | struct byt_rt5651_private *priv; |
| 868 | struct snd_soc_acpi_mach *mach; | 868 | struct snd_soc_acpi_mach *mach; |
| 869 | const char *platform_name; | 869 | const char *platform_name; |
| 870 | struct acpi_device *adev; | ||
| 870 | struct device *codec_dev; | 871 | struct device *codec_dev; |
| 871 | const char *i2c_name = NULL; | ||
| 872 | const char *hp_swapped; | 872 | const char *hp_swapped; |
| 873 | bool is_bytcr = false; | 873 | bool is_bytcr = false; |
| 874 | int ret_val = 0; | 874 | int ret_val = 0; |
| @@ -894,14 +894,16 @@ static int snd_byt_rt5651_mc_probe(struct platform_device *pdev) | |||
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | /* fixup codec name based on HID */ | 896 | /* fixup codec name based on HID */ |
| 897 | i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); | 897 | adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); |
| 898 | if (!i2c_name) { | 898 | if (adev) { |
| 899 | snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), | ||
| 900 | "i2c-%s", acpi_dev_name(adev)); | ||
| 901 | put_device(&adev->dev); | ||
| 902 | byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; | ||
| 903 | } else { | ||
| 899 | dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); | 904 | dev_err(&pdev->dev, "Error cannot find '%s' dev\n", mach->id); |
| 900 | return -ENODEV; | 905 | return -ENODEV; |
| 901 | } | 906 | } |
| 902 | snprintf(byt_rt5651_codec_name, sizeof(byt_rt5651_codec_name), | ||
| 903 | "%s%s", "i2c-", i2c_name); | ||
| 904 | byt_rt5651_dais[dai_index].codec_name = byt_rt5651_codec_name; | ||
| 905 | 907 | ||
| 906 | codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, | 908 | codec_dev = bus_find_device_by_name(&i2c_bus_type, NULL, |
| 907 | byt_rt5651_codec_name); | 909 | byt_rt5651_codec_name); |
