From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: linux-spi@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>,
linux-acpi@vger.kernel.org, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
Robert Jarzmik <robert.jarzmik@free.fr>,
Jarkko Nikula <jarkko.nikula@linux.intel.com>
Subject: [PATCH 2/2] spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device()
Date: Fri, 25 Sep 2015 10:27:18 +0300 [thread overview]
Message-ID: <1443166038-31658-2-git-send-email-jarkko.nikula@linux.intel.com> (raw)
In-Reply-To: <1443166038-31658-1-git-send-email-jarkko.nikula@linux.intel.com>
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(-)
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))
--
2.5.3
next prev parent reply other threads:[~2015-09-25 7:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-25 7:27 [PATCH 1/2] spi: pxa2xx: Set the max_speed_hz of the master Jarkko Nikula
2015-09-25 7:27 ` Jarkko Nikula [this message]
[not found] ` <1443166038-31658-2-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-09-25 16:55 ` Applied "spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device()" to the spi tree Mark Brown
2015-09-25 23:56 ` [PATCH 2/2] spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device() Rafael J. Wysocki
[not found] ` <1443166038-31658-1-git-send-email-jarkko.nikula-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2015-09-25 16:55 ` Applied "spi: pxa2xx: Set the max_speed_hz of the master" to the spi tree Mark Brown
2015-09-26 9:23 ` [PATCH 1/2] spi: pxa2xx: Set the max_speed_hz of the master Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443166038-31658-2-git-send-email-jarkko.nikula@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=broonie@kernel.org \
--cc=daniel@zonque.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).