From patchwork Fri Aug 25 16:43:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Yu X-Patchwork-Id: 9922479 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC0F6602BD for ; Fri, 25 Aug 2017 16:42:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD958280CF for ; Fri, 25 Aug 2017 16:42:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2A1C283CF; Fri, 25 Aug 2017 16:42:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56871280CF for ; Fri, 25 Aug 2017 16:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934483AbdHYQmB (ORCPT ); Fri, 25 Aug 2017 12:42:01 -0400 Received: from mga01.intel.com ([192.55.52.88]:35943 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934266AbdHYQmB (ORCPT ); Fri, 25 Aug 2017 12:42:01 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Aug 2017 09:42:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,426,1498546800"; d="scan'208";a="122600760" Received: from yu-desktop-1.sh.intel.com ([10.239.160.151]) by orsmga004.jf.intel.com with ESMTP; 25 Aug 2017 09:41:59 -0700 From: Chen Yu To: linux-acpi@vger.kernel.org Cc: linux-pm@vger.kernel.org, "Rafael J. Wysocki" , Len Brown , Chen Yu , linux-kernel@vger.kernel.org Subject: [PATCH 1/2][RFC] ACPI / PM: Reuse the acpi_sleep_syscore_ops for future requirement Date: Sat, 26 Aug 2017 00:43:30 +0800 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There might be other actions to be taken during the acpi syscore suspend/resume phase, thus reuse the acpi_sleep_syscore_ops in case other operations are added into the acpi_sleep_syscore_ops. No functional change. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-pm@vger.kernel.org Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Chen Yu --- drivers/acpi/sleep.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index fa8243c..cad1a0f 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c @@ -865,9 +865,19 @@ static void acpi_restore_bm_rld(void) acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld); } +static int acpi_syscore_suspend(void) +{ + return acpi_save_bm_rld(); +} + +static void acpi_syscore_restore(void) +{ + acpi_restore_bm_rld(); +} + static struct syscore_ops acpi_sleep_syscore_ops = { - .suspend = acpi_save_bm_rld, - .resume = acpi_restore_bm_rld, + .suspend = acpi_syscore_suspend, + .resume = acpi_syscore_restore, }; void acpi_sleep_syscore_init(void)