diff mbox

[2/2] spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device()

Message ID 1443166038-31658-2-git-send-email-jarkko.nikula@linux.intel.com (mailing list archive)
State Accepted
Commit b9f6940a437dcb8481df16b175359e126cf7bc33
Headers show

Commit Message

Jarkko Nikula Sept. 25, 2015, 7:27 a.m. UTC
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>
---
 drivers/spi/spi-pxa2xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Sept. 25, 2015, 11:56 p.m. UTC | #1
On Friday, September 25, 2015 10:27:18 AM Jarkko Nikula wrote:
> 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>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

> ---
>  drivers/spi/spi-pxa2xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> index 36cbb0f10856..6f834e5b0547 100644
> --- a/drivers/spi/spi-pxa2xx.c
> +++ b/drivers/spi/spi-pxa2xx.c
> @@ -1316,8 +1316,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))
>
diff mbox

Patch

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 36cbb0f10856..6f834e5b0547 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1316,8 +1316,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))