Skip to content

Commit c8aa49a

Browse files
andy-shevbroonie
authored andcommitted
ASoC: Intel: bytcr_wm5102: Drop reference count of ACPI device after use
Theoretically the device might gone if its reference count drops to 0. This might be the case when we try to find the first physical node of the ACPI device. We need to keep reference to it until we get a result of the above mentioned call. Refactor the code to drop the reference count at the correct place. While at it, move to acpi_dev_put() as symmetrical call to the acpi_dev_get_first_match_dev(). Fixes: 9a87fc1 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102") Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent cbf87bc commit c8aa49a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sound/soc/intel/boards/bytcr_wm5102.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ static int snd_byt_wm5102_mc_probe(struct platform_device *pdev)
411411
return -ENOENT;
412412
}
413413
snprintf(codec_name, sizeof(codec_name), "spi-%s", acpi_dev_name(adev));
414-
put_device(&adev->dev);
415414

416415
codec_dev = bus_find_device_by_name(&spi_bus_type, NULL, codec_name);
416+
acpi_dev_put(adev);
417417
if (!codec_dev)
418418
return -EPROBE_DEFER;
419419

0 commit comments

Comments
 (0)