From patchwork Mon Jan 30 17:15:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 9545761 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 280ED604A8 for ; Mon, 30 Jan 2017 17:21:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 052EC25D9E for ; Mon, 30 Jan 2017 17:21:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE21E26E97; Mon, 30 Jan 2017 17:21:44 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 83F9C25D9E for ; Mon, 30 Jan 2017 17:21:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750836AbdA3RVn (ORCPT ); Mon, 30 Jan 2017 12:21:43 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36746 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbdA3RVm (ORCPT ); Mon, 30 Jan 2017 12:21:42 -0500 Received: by mail-wm0-f65.google.com with SMTP id r18so7044993wmd.3; Mon, 30 Jan 2017 09:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ttdzS0RPXN5ux+COvCBVxnATBSJ4kXOCeordGk7tTDE=; b=Afd7DrueuCjKIFhWBRTSBViQK412zQVTiy80FKFYf9fZLdTesTlSkywZDF8rjYSzOr hQ1EnEzoCW55mYTXvbffhQfMFtkcbeo3pQtRJMlebihy8ZWVTZxd/v3Q2SM1noCtp9dT w9IZP6MW/ApY60CvRMBrWN+dFTL5VbsvKF5wUV009VtUtHkQUATFMbWqhrrSJShtncfQ poq7eSeewwsbkMBrg9OvuOPkQ+xkpUVTD1H9aJoMZS0/TT0grXSghtrZKBVcOBGmpsP8 qQ5lI7ptiqiIYE54OMIaNDtWlfKk17pFGaUTz3+bhEVfoOIFwmjzUTthUCnqik9vzgdi tc3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ttdzS0RPXN5ux+COvCBVxnATBSJ4kXOCeordGk7tTDE=; b=pcoKbM8iZwAwiZ3dn23sZn9LHQy2rXdjech5KwIxJEdsCzy9wtlKozkOj/wvckweCP mrsW1Ze7R+7BlBpzCZqjgD9Cw0LZPDOzz/q7RxlrZnHrVXQaI0zq/Q2ltwYAZHwowGEe jXOE6Mmhoqs/PtIepp2/b8y5CWsBalKkUVGSZW0PFJzjk6O9kVQXspR6fBA+DxlZz/rA FCcfHOQyDXT+rm7zPD7wMjyxJJXQ65xkKfPYuYk2IoY4B5Tav4mn3+AXF0FI4tnTLqa/ xi6osojkW0+IL8uFZ2GjsHYEg2UPl97hqp+sdKgJFGCxdegCzX9DnyHCnIcZczQiWmWw PMPA== X-Gm-Message-State: AIkVDXI0bIv86F2CTqlImAITmwgl9CuOuzTVzfptL8wv8Z1nPQgL1XfVlTswKvYuiTnaoQ== X-Received: by 10.28.236.79 with SMTP id k76mr14452662wmh.79.1485796514263; Mon, 30 Jan 2017 09:15:14 -0800 (PST) Received: from localhost (port-6519.pppoe.wtnet.de. [84.46.25.144]) by smtp.gmail.com with ESMTPSA id x25sm23849458wrx.27.2017.01.30.09.15.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jan 2017 09:15:13 -0800 (PST) From: Thierry Reding To: Linus Torvalds , Greg Kroah-Hartman , "Rafael J . Wysocki" , Pavel Machek Cc: Sebastian Reichel , Guenter Roeck , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 3/3] PM / hibernate: Wire up system-power framework Date: Mon, 30 Jan 2017 18:15:06 +0100 Message-Id: <20170130171506.3527-4-thierry.reding@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170130171506.3527-1-thierry.reding@gmail.com> References: <20170130171506.3527-1-thierry.reding@gmail.com> 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 From: Thierry Reding Use the system-power framework's equivalent to test for power off capability instead of relying on the globally defined pm_power_off() function pointer. The system-power framework implements a fallback that relies on this global function in case no system power chips have been registered. Moving this to the system-power framework allows us to eventually remove any traces of pm_power_off() once all handlers have moved over to the new framework. Signed-off-by: Thierry Reding --- kernel/power/hibernate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index b26dbc48c75b..e7429ea11e9a 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c @@ -30,6 +30,7 @@ #include #include #include +#include #include "power.h" @@ -617,7 +618,7 @@ static void power_down(void) case HIBERNATION_PLATFORM: hibernation_platform_enter(); case HIBERNATION_SHUTDOWN: - if (pm_power_off) + if (system_can_power_off()) kernel_power_off(); break; #ifdef CONFIG_SUSPEND