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

Rafael J. Wysocki
2015-09-25T23:56:09Z

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))
>

--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.