From: Jarkko Nikula Date: Fri, 25 Sep 2015 07:27:18 +0000 (+0300) Subject: spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9f6940a437dcb8481df16b175359e126cf7bc33;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device() 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 Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 0e075db589ca..aed9aabec14f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -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))