From patchwork Mon Jan 19 23:07:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5661461 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 5B84EC058D for ; Mon, 19 Jan 2015 23:08:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 97CC720394 for ; Mon, 19 Jan 2015 23:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CE2AD20386 for ; Mon, 19 Jan 2015 23:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751922AbbASXII (ORCPT ); Mon, 19 Jan 2015 18:08:08 -0500 Received: from mail-la0-f51.google.com ([209.85.215.51]:42161 "EHLO mail-la0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751896AbbASXIH (ORCPT ); Mon, 19 Jan 2015 18:08:07 -0500 Received: by mail-la0-f51.google.com with SMTP id ge10so10307076lab.10 for ; Mon, 19 Jan 2015 15:08:04 -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=mV3wKsbCLBmwCPAVWmMrIVRUHErh4DZpJ+Rq+ElaKSw=; b=b8d4xYvEyCFpctTvKEPdHA0WRIHO41qQ6pGDWM0VgcjyNzpJqP4dM6qdieo/ClY9gw JU3kzxeddGWLJxuxanJQVxSuKq5qvh25sd04uCal1QIE0cncDA2LW3DiT1XVs3DT9LeC 0iygGXXmirgQVNmHUgh8T35UizWwbU+oIFaPTw3mDIkd1TELvEy+te5NDOvpGXSCFclm OcAAsi7ZZpkSxPYjdMTbHMSmfotGRFmwlQzyLGcqeVCuhl0UrVCvkoix2ry++XZ+fFRb E0ppfdF63NyHxemHe4Om8V/7uYNlh/2sAxeY4K6QofLCxW+Viqc8svcQw7fCiWuLP+ZQ JiqQ== X-Gm-Message-State: ALoCoQknJ38an309e7Y50jr/l13k46qL8sYrMTZwM7o8R1K2PSoTEk2dw8Am1U0K0irjBxG6TvRK X-Received: by 10.112.8.41 with SMTP id o9mr34430588lba.40.1421708884859; Mon, 19 Jan 2015 15:08:04 -0800 (PST) Received: from wasted.cogentembedded.com (ppp30-86.pppoe.mtu-net.ru. [81.195.30.86]) by mx.google.com with ESMTPSA id 1sm4033666lay.40.2015.01.19.15.08.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 15:08:04 -0800 (PST) From: Sergei Shtylyov To: vinod.koul@intel.com, dan.j.williams@intel.com, dmaengine@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH 2/2] shdmac: extend PM methods Date: Tue, 20 Jan 2015 02:07:59 +0300 Message-ID: <7124495.gOhk31Ctg5@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 sh_dmae_{suspend|resume}() for the {freeze| thaw|restore}() PM methods. It's handy to achieve this with SIMPLE_DEV_PM_OPS() macro; since that macro doesn't do anything when CONFIG_PM_SLEEP is undefined, we don't need to #define sh_dmae_{suspend|resume} NULL anymore; it seems safe to leave the #ifdef CONFIG_PM alone as this option is selected by CONFIG_PM_SLEEP anyway... Based on orignal patch by Mikhail Ulyanov . Signed-off-by: Sergei Shtylyov --- The patch is against the 'next' branch of Vinod Koul's 'slave-dma.git' repo. drivers/dma/sh/shdmac.c | 6 +----- 1 file changed, 1 insertion(+), 5 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: slave-dma/drivers/dma/sh/shdmac.c =================================================================== --- slave-dma.orig/drivers/dma/sh/shdmac.c +++ slave-dma/drivers/dma/sh/shdmac.c @@ -632,14 +632,10 @@ static int sh_dmae_resume(struct device return 0; } -#else -#define sh_dmae_suspend NULL -#define sh_dmae_resume NULL #endif static const struct dev_pm_ops sh_dmae_pm = { - .suspend = sh_dmae_suspend, - .resume = sh_dmae_resume, + SET_SYSTEM_SLEEP_PM_OPS(sh_dmae_suspend, sh_dmae_resume) SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, NULL) };