From patchwork Fri Jan 16 21:56:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5650571 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@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 976659F2ED for ; Fri, 16 Jan 2015 21:56:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B8833202C8 for ; Fri, 16 Jan 2015 21:56:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 95A9A20268 for ; Fri, 16 Jan 2015 21:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbbAPV4H (ORCPT ); Fri, 16 Jan 2015 16:56:07 -0500 Received: from mail-la0-f44.google.com ([209.85.215.44]:55950 "EHLO mail-la0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751390AbbAPV4G (ORCPT ); Fri, 16 Jan 2015 16:56:06 -0500 Received: by mail-la0-f44.google.com with SMTP id gd6so21277125lab.3 for ; Fri, 16 Jan 2015 13:56:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=eala9ayunK+3pfB7O0aSClOjh73ONVLmYrD1SoBIujM=; b=UunedzLI0q7/jU5ZWjxIWMz3H/EK5KNuq9v1YIVYb630zcDfsfSORcCv7AOog7tzyh dKiQW85jbocWH09VzL3o+++XMLqQxI/IhF6xXseNqpX3PEXTakqpoXWb3oEyXkayVl6J v9t57kfuBrFQMi4fwfKeHEAZPKZpqod13XG4CFQD0kAwMVrtcwuJgwjo/FnYuHjXAym/ IsNqOv8M1BTWvPXZimM4yHH6lMDRKx2AfYW+1tX1ottrlElRZdXxpCxnsCl/PoOL9735 QHbPowDhyAEqLF12SQc4t/gYC5AqdsRDiEY1aSNNiyO//gpqw+4SCWG0BvDzc/J570lY NhtQ== X-Gm-Message-State: ALoCoQmcjTPXLMI5KIBSJaqGuD1EKAw8esnRP0OPy7WHKI7EVxPkjn2jzx/rxT+T49Zjm62lEU+z X-Received: by 10.112.130.34 with SMTP id ob2mr18128056lbb.78.1421445363633; Fri, 16 Jan 2015 13:56:03 -0800 (PST) Received: from wasted.cogentembedded.com (ppp27-207.pppoe.mtu-net.ru. [81.195.27.207]) by mx.google.com with ESMTPSA id ao2sm1726911lac.8.2015.01.16.13.56.01 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 13:56:02 -0800 (PST) Date: Fri, 16 Jan 2015 13:56:02 -0800 (PST) X-Google-Original-Date: Sat, 17 Jan 2015 00:56 +0300 From: Sergei Shtylyov To: gregkh@linuxfoundation.org, jslaby@suse.cz, linux-serial@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH] sh-sci: extend PM methods Message-ID: <3390015.epzKE7eYAi@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.3 (Linux/3.17.8-200.fc20.x86_64; KDE/4.14.3; x86_64; ; ) MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 In order to make it possible to restore from hibernation not only in Linux but also in e.g. U-Boot, we have to use sci_{suspend|remove}() for the PM {freeze| thaw|restore}() methods. It's handy to achieve this by using SIMPLE_DEV_PM_OPS() macro, however we have to annotate sci_{suspend|remove}() with '__maybe_unused' in order to avoid compilation warnings when CONFIG_PM_SLEEP is undefined. Based on orignal patch by Mikhail Ulyanov . Signed-off-by: Sergei Shtylyov --- This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo. drivers/tty/serial/sh-sci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: tty/drivers/tty/serial/sh-sci.c =================================================================== --- tty.orig/drivers/tty/serial/sh-sci.c +++ tty/drivers/tty/serial/sh-sci.c @@ -2605,7 +2605,7 @@ static int sci_probe(struct platform_dev return 0; } -static int sci_suspend(struct device *dev) +static __maybe_unused int sci_suspend(struct device *dev) { struct sci_port *sport = dev_get_drvdata(dev); @@ -2615,7 +2615,7 @@ static int sci_suspend(struct device *de return 0; } -static int sci_resume(struct device *dev) +static __maybe_unused int sci_resume(struct device *dev) { struct sci_port *sport = dev_get_drvdata(dev); @@ -2625,10 +2625,7 @@ static int sci_resume(struct device *dev return 0; } -static const struct dev_pm_ops sci_dev_pm_ops = { - .suspend = sci_suspend, - .resume = sci_resume, -}; +static SIMPLE_DEV_PM_OPS(sci_dev_pm_ops, sci_suspend, sci_resume); static struct platform_driver sci_driver = { .probe = sci_probe,