diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-03-28 13:17:23 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-04-01 05:00:16 -0400 |
commit | 1b55f1c6fd64efd7b1339664edc1222ad99f9c9b (patch) | |
tree | 38948df819b405943db511198dac64e88a52d1a4 | |
parent | d00d2109c3679bf87d412b1667bcb6d42c1ac12f (diff) |
ASoC: Intel: bytcht_da7213: Convert to use acpi_dev_get_first_match_dev()
acpi_dev_get_first_match_name() is deprecated and going to be removed
because it leaks a reference.
Convert the driver to use acpi_dev_get_first_match_dev() instead.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | sound/soc/intel/boards/bytcht_da7213.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sound/soc/intel/boards/bytcht_da7213.c b/sound/soc/intel/boards/bytcht_da7213.c index b8e884803777..4decba338156 100644 --- a/sound/soc/intel/boards/bytcht_da7213.c +++ b/sound/soc/intel/boards/bytcht_da7213.c | |||
@@ -226,7 +226,7 @@ static int bytcht_da7213_probe(struct platform_device *pdev) | |||
226 | struct snd_soc_card *card; | 226 | struct snd_soc_card *card; |
227 | struct snd_soc_acpi_mach *mach; | 227 | struct snd_soc_acpi_mach *mach; |
228 | const char *platform_name; | 228 | const char *platform_name; |
229 | const char *i2c_name = NULL; | 229 | struct acpi_device *adev; |
230 | int dai_index = 0; | 230 | int dai_index = 0; |
231 | int ret_val = 0; | 231 | int ret_val = 0; |
232 | int i; | 232 | int i; |
@@ -244,10 +244,11 @@ static int bytcht_da7213_probe(struct platform_device *pdev) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | /* fixup codec name based on HID */ | 246 | /* fixup codec name based on HID */ |
247 | i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1); | 247 | adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1); |
248 | if (i2c_name) { | 248 | if (adev) { |
249 | snprintf(codec_name, sizeof(codec_name), | 249 | snprintf(codec_name, sizeof(codec_name), |
250 | "%s%s", "i2c-", i2c_name); | 250 | "i2c-%s", acpi_dev_name(adev)); |
251 | put_device(&adev->dev); | ||
251 | dailink[dai_index].codec_name = codec_name; | 252 | dailink[dai_index].codec_name = codec_name; |
252 | } | 253 | } |
253 | 254 | ||