]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device()
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Fri, 25 Sep 2015 07:27:18 +0000 (10:27 +0300)
committerMark Brown <broonie@kernel.org>
Fri, 25 Sep 2015 16:52:19 +0000 (09:52 -0700)
Get pointer to the struct acpi_device by using ACPI_COMPANION() macro. This
is more efficient than using ACPI_HANDLE() and acpi_bus_get_device().

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c

index 0e075db589ca64aee4b73a44cb4bd77a4ec8404a..aed9aabec14f71f38d8765b493414e25e4b8e193 100644 (file)
@@ -1312,8 +1312,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
        const struct pci_device_id *pcidev_id = NULL;
        int devid, type;
 
-       if (!ACPI_HANDLE(&pdev->dev) ||
-           acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev))
+       adev = ACPI_COMPANION(&pdev->dev);
+       if (!adev)
                return NULL;
 
        if (dev_is_pci(pdev->dev.parent))