struct device *dev = &pdev->dev;
        struct snd_soc_acpi_mach *mach;
        const char *platform_name;
-       const char *i2c_name = NULL;
+       struct acpi_device *adev;
        struct device *codec_dev;
        int dai_index = 0;
        int i;
        }
 
        /* 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(codec_name, sizeof(codec_name),
-                       "%s%s", "i2c-", i2c_name);
+                        "i2c-%s", acpi_dev_name(adev));
+               put_device(&adev->dev);
                byt_cht_es8316_dais[dai_index].codec_name = codec_name;
        }