From patchwork Fri Sep 25 07:27:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 7262761 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9878C9F380 for ; Fri, 25 Sep 2015 07:27:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D54032095E for ; Fri, 25 Sep 2015 07:27:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E9CC920951 for ; Fri, 25 Sep 2015 07:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751954AbbIYH1b (ORCPT ); Fri, 25 Sep 2015 03:27:31 -0400 Received: from mga09.intel.com ([134.134.136.24]:36067 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbbIYH1a (ORCPT ); Fri, 25 Sep 2015 03:27:30 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 25 Sep 2015 00:27:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,585,1437462000"; d="scan'208";a="812922846" Received: from mylly.fi.intel.com (HELO mylly.fi.intel.com.) ([10.237.72.66]) by orsmga002.jf.intel.com with ESMTP; 25 Sep 2015 00:27:28 -0700 From: Jarkko Nikula To: linux-spi@vger.kernel.org Cc: Mark Brown , linux-acpi@vger.kernel.org, Daniel Mack , Haojian Zhuang , Robert Jarzmik , Jarkko Nikula Subject: [PATCH 2/2] spi: pxa2xx: Use ACPI_COMPANION() instead of acpi_bus_get_device() Date: Fri, 25 Sep 2015 10:27:18 +0300 Message-Id: <1443166038-31658-2-git-send-email-jarkko.nikula@linux.intel.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: <1443166038-31658-1-git-send-email-jarkko.nikula@linux.intel.com> References: <1443166038-31658-1-git-send-email-jarkko.nikula@linux.intel.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Rafael J. Wysocki --- 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))