From patchwork Fri Dec 6 07:36:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 3293411 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CB3219F373 for ; Fri, 6 Dec 2013 07:36:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AF2E204AF for ; Fri, 6 Dec 2013 07:36:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F17582049C for ; Fri, 6 Dec 2013 07:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753265Ab3LFHgb (ORCPT ); Fri, 6 Dec 2013 02:36:31 -0500 Received: from mga02.intel.com ([134.134.136.20]:44787 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753205Ab3LFHgb (ORCPT ); Fri, 6 Dec 2013 02:36:31 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 Dec 2013 23:36:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,839,1378882800"; d="scan'208";a="420332955" Received: from unknown (HELO localhost) ([10.255.21.72]) by orsmga001.jf.intel.com with ESMTP; 05 Dec 2013 23:36:29 -0800 From: Lan Tianyu To: lenb@kernel.org, rjw@rjwysocki.net Cc: Lan Tianyu , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ACPI/Processor: use ACPI_COMPANION to get ACPI device Date: Fri, 6 Dec 2013 15:36:26 +0800 Message-Id: <1386315386-4650-1-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.2.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.1 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 Using ACPI_COMPANION to get ACPI device instead of acpi_bus_get_device(). Signed-off-by: Lan Tianyu --- drivers/acpi/processor_driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 146ab7e..c1c3562 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -224,9 +224,9 @@ static int __acpi_processor_start(struct acpi_device *device) static int acpi_processor_start(struct device *dev) { - struct acpi_device *device; + struct acpi_device *device = ACPI_COMPANION(dev); - if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) + if (!device) return -ENODEV; return __acpi_processor_start(device); @@ -234,10 +234,10 @@ static int acpi_processor_start(struct device *dev) static int acpi_processor_stop(struct device *dev) { - struct acpi_device *device; + struct acpi_device *device = ACPI_COMPANION(dev); struct acpi_processor *pr; - if (acpi_bus_get_device(ACPI_HANDLE(dev), &device)) + if (!device) return 0; acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,