]> Git Repo - linux.git/commitdiff
ASoC: Intel: cht_bsw_rt5672: Convert to use acpi_dev_get_first_match_dev()
authorAndy Shevchenko <[email protected]>
Thu, 28 Mar 2019 17:17:28 +0000 (19:17 +0200)
committerRafael J. Wysocki <[email protected]>
Mon, 1 Apr 2019 09:00:16 +0000 (11:00 +0200)
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 <[email protected]>
Acked-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
sound/soc/intel/boards/cht_bsw_rt5672.c

index 3d5a2b3a06f0816201a8fca6e9040f6a34dd3e72..0f7770822388ebb3f7377e90d78b9c656f36db7e 100644 (file)
@@ -401,7 +401,7 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
        struct cht_mc_private *drv;
        struct snd_soc_acpi_mach *mach = pdev->dev.platform_data;
        const char *platform_name;
-       const char *i2c_name;
+       struct acpi_device *adev;
        int i;
 
        drv = devm_kzalloc(&pdev->dev, sizeof(*drv), GFP_KERNEL);
@@ -411,10 +411,11 @@ static int snd_cht_mc_probe(struct platform_device *pdev)
        strcpy(drv->codec_name, RT5672_I2C_DEFAULT);
 
        /* fixup codec name based on HID */
-       i2c_name = acpi_dev_get_first_match_name(mach->id, NULL, -1);
-       if (i2c_name) {
+       adev = acpi_dev_get_first_match_dev(mach->id, NULL, -1);
+       if (adev) {
                snprintf(drv->codec_name, sizeof(drv->codec_name),
-                        "i2c-%s", i2c_name);
+                        "i2c-%s", acpi_dev_name(adev));
+               put_device(&adev->dev);
                for (i = 0; i < ARRAY_SIZE(cht_dailink); i++) {
                        if (!strcmp(cht_dailink[i].codec_name,
                                RT5672_I2C_DEFAULT)) {
This page took 0.060064 seconds and 4 git commands to generate.