From patchwork Mon Jan 19 22:41:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5661421 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E10BDC058D for ; Mon, 19 Jan 2015 22:41:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A5F19203F3 for ; Mon, 19 Jan 2015 22:41:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBA24203C4 for ; Mon, 19 Jan 2015 22:41:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752154AbbASWly (ORCPT ); Mon, 19 Jan 2015 17:41:54 -0500 Received: from mail-la0-f50.google.com ([209.85.215.50]:42918 "EHLO mail-la0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751726AbbASWlx (ORCPT ); Mon, 19 Jan 2015 17:41:53 -0500 Received: by mail-la0-f50.google.com with SMTP id pn19so31204919lab.9 for ; Mon, 19 Jan 2015 14:41:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=bgXOKYJjFHAp18ijQVRSGpmIDFqzLCmjol+wmeUCwqw=; b=FQ0ezSVUmPwZM9urIwJ01kUdQd/xNaIstFamq5Zfypy4bzGo2RfBmmmDVlCQu0cFFn 8hbwLgNWF49LAVvrqxUQTEPs6QACcICyXTEJ/t5lulxC/+k9AM0Uq8PWwzjnzZm67Sds 95tz7xuot9uJVZIwcxqA4uzUOq/foxq8Tmvxj0Gnp8v/ZFOmsFCT1Ry1iQjXqvZSAfaw 6IwltJU1y1Bs5/bBfNN5USv8q+L1JfSvdoqGqVgD8yPqR17UwU42Fc5t419sDJUSHZtG 3ZUDYFIFPaTr3UeKIabb1kZDQBY1pYfqU0nS+WOEQ4XsmfDzdxSX4LaeB+rlZ3+SS4P5 /leg== X-Gm-Message-State: ALoCoQmaTNmBrZbW0XvUibdJ2cgpAqmhADphsn3TqXOoxp3EqKp5FyhQ5da6e2w5kbbPTBXg6Vok X-Received: by 10.112.142.201 with SMTP id ry9mr34986352lbb.4.1421707311382; Mon, 19 Jan 2015 14:41:51 -0800 (PST) Received: from wasted.cogentembedded.com (ppp30-86.pppoe.mtu-net.ru. [81.195.30.86]) by mx.google.com with ESMTPSA id ee5sm729133lad.18.2015.01.19.14.41.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 14:41:50 -0800 (PST) From: Sergei Shtylyov To: gregkh@linuxfoundation.org, jslaby@suse.cz, linux-serial@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH v2] sh-sci: extend PM methods Date: Tue, 20 Jan 2015 01:41:48 +0300 Message-ID: <2058633.0nQGRBdejF@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|resume}() 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 original patch by Mikhail Ulyanov . Signed-off-by: Sergei Shtylyov --- This patch is against the 'tty-next' branch of GregKH's 'tty.git' repo. Changes in version 2: - fixed typos and too long line in the changelog. 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,