From patchwork Tue Jan 20 21:09:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 5672321 Return-Path: X-Original-To: patchwork-dmaengine@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 1E92BC058E for ; Tue, 20 Jan 2015 21:09:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4EFE720498 for ; Tue, 20 Jan 2015 21:09:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D47F204E3 for ; Tue, 20 Jan 2015 21:09:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754060AbbATVJw (ORCPT ); Tue, 20 Jan 2015 16:09:52 -0500 Received: from mail-la0-f42.google.com ([209.85.215.42]:46113 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092AbbATVJv (ORCPT ); Tue, 20 Jan 2015 16:09:51 -0500 Received: by mail-la0-f42.google.com with SMTP id ms9so14517508lab.1 for ; Tue, 20 Jan 2015 13:09:49 -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=7EyJL9ZpcH9dau5yTcO2ca17O517njHgxZNHfbCvg6Y=; b=MyX2KmZg95tswGPArlr9FRi+GNUINImxw+31NvU3cmebTC+h4x2j+YbfRlJ9N5ynAZ liFQFE5zvPXbDfEDDhg41MXG9qIDA23EWb9eS6hptGiCafZFBQP+7PZDPE0rts+d6pD4 JtfvZwKH5fTVUFd3re3G332FCQBLx/JgWwoTM/apaLGkTxt+aiCcXn+LDQBY5aXmqNf8 B02VTE1QYACEmKCtT5xxqQEGl/CMB8Wbqb/ABTINc5rryMqjo7wYOBDjR2Tjg3GA07a1 CkcEECFES3n58XsBTmlakL1Ut0qWKSUdCa4glQhWdCw0TYt+0LYXAWe7oejyHLbfy5PR fJ8w== X-Gm-Message-State: ALoCoQmFbAvyIezdZtoMkSwlWK2mNzQFgEigkz3MQ2+QOoIyvrPJCUavg4XpbbArm0WouR9J3hUi X-Received: by 10.152.42.164 with SMTP id p4mr34207504lal.45.1421788189672; Tue, 20 Jan 2015 13:09:49 -0800 (PST) Received: from wasted.cogentembedded.com (ppp17-152.pppoe.mtu-net.ru. [81.195.17.152]) by mx.google.com with ESMTPSA id ji3sm4294793lbc.38.2015.01.20.13.09.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jan 2015 13:09:48 -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, mikhail.ulyanov@cogentembedded.com Subject: [PATCH v2 1/2] shdmac: use SET_RUNTIME_PM_OPS() Date: Wed, 21 Jan 2015 00:09:46 +0300 Message-ID: <9005734.b9UuUHqyUV@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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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=unavailable 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 Use SET_RUNTIME_PM_OPS() to initialize the runtime PM method pointers in the 'struct dev_pm_ops'; since that macro doesn't do anything if CONFIG_PM is not defined, we have to move #ifdef up to also cover the runtime PM methods in order to avoid compilation warnings. 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, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe dmaengine" 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 @@ -588,6 +588,7 @@ static void sh_dmae_shutdown(struct plat sh_dmae_ctl_stop(shdev); } +#ifdef CONFIG_PM static int sh_dmae_runtime_suspend(struct device *dev) { return 0; @@ -600,7 +601,6 @@ static int sh_dmae_runtime_resume(struct return sh_dmae_rst(shdev); } -#ifdef CONFIG_PM static int sh_dmae_suspend(struct device *dev) { return 0; @@ -640,8 +640,8 @@ static int sh_dmae_resume(struct device static const struct dev_pm_ops sh_dmae_pm = { .suspend = sh_dmae_suspend, .resume = sh_dmae_resume, - .runtime_suspend = sh_dmae_runtime_suspend, - .runtime_resume = sh_dmae_runtime_resume, + SET_RUNTIME_PM_OPS(sh_dmae_runtime_suspend, sh_dmae_runtime_resume, + NULL) }; static dma_addr_t sh_dmae_slave_addr(struct shdma_chan *schan)