sdhci: acpi: Use new method to get ACPI companion
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 24 Jul 2017 14:59:58 +0000 (17:59 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 30 Aug 2017 12:01:39 +0000 (14:01 +0200)
ACPI_COMPANION() macro reduces a code to get a companion device out of
struct device.

Use it instead of an old method.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci-acpi.c

index 2b1df88..08ae0ff 100644 (file)
@@ -429,7 +429,6 @@ static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid,
 static int sdhci_acpi_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       acpi_handle handle = ACPI_HANDLE(dev);
        struct acpi_device *device, *child;
        struct sdhci_acpi_host *c;
        struct sdhci_host *host;
@@ -439,7 +438,8 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
        const char *uid;
        int err;
 
-       if (acpi_bus_get_device(handle, &device))
+       device = ACPI_COMPANION(dev);
+       if (!device)
                return -ENODEV;
 
        hid = acpi_device_hid(device);