From patchwork Wed Jun 5 21:20:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2674611 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B0D09DFF66 for ; Wed, 5 Jun 2013 21:20:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932576Ab3FEVUv (ORCPT ); Wed, 5 Jun 2013 17:20:51 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:51092 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932570Ab3FEVUu (ORCPT ); Wed, 5 Jun 2013 17:20:50 -0400 Received: by mail-la0-f48.google.com with SMTP id lx15so900927lab.21 for ; Wed, 05 Jun 2013 14:20:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id:x-gm-message-state; bh=XRyuz3kF4DC4f1XoqJpmice0blxRK3jenen+YGrMomI=; b=p1gos5l1w7HZoAT2Md9mC9YsObqLp0bbs/WkuyqrfPmhj7LDiOc7pZoCw2zDP/Fqlk GJUJR1DsSfEK6arfMQrChQh3cAi3lFy+SPjYebMKgl2SvSlgYm7HHhA/Q3SG6nNGkwA/ mjCDsMWZ7mvJJT3yrtuWHAtc974z8VSUC+RgCUj/8dE0GPGqxRSzpGvsc7gDMoePt323 609UXEFiCSfm75WlYrsJPag6NfjfEw6kBLIWk89J98Zg1vn2sfHPxt6MSVlalOZuCknX /uHZkfSFzN9UyykiapCbHN9BYhPDlF4yFRec3HfbD0Ty//ubDL8j5QyQAd1uKoWctXku 6WJQ== X-Received: by 10.152.22.199 with SMTP id g7mr15469453laf.20.1370467248486; Wed, 05 Jun 2013 14:20:48 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-88-205.pppoe.mtu-net.ru. [91.76.88.205]) by mx.google.com with ESMTPSA id 4sm10210411lao.0.2013.06.05.14.20.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 05 Jun 2013 14:20:47 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: netdev@vger.kernel.org Subject: [PATCH v4 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM Date: Thu, 6 Jun 2013 01:20:53 +0400 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.i686.PAE; KDE/4.4.5; i686; ; ) Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org References: <201306060106.51082.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306060106.51082.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306060120.53740.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQmcay31TWF4EX9YTDyUiS40AP/EzAtabbpCoAHjPMHLI0+Q4ronFyW4czyRv7O3asmxSGN0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Nobuhiro Iwamatsu Put '#ifdef CONFIG_PM' around sh_eth_runtime_nop() and 'sh_eth_dev_pm_ops'. Add '#define SH_ETH_PM_OPS' to facilitate initialization of driver's 'pm' field depending on whether CONFIG_PM is enabled. Signed-off-by: Nobuhiro Iwamatsu [Sergei: added the changelog, reworded the subject, changing the prefix.] Signed-off-by: Sergei Shtylyov --- Changes in version 4: - refreshed the patch; - added the changelog; - reworded the subject, changing the prefix. Changes in version 3: - fixed "ERROR: Macros with complex values should be enclosed in parenthesis" by scripts/checkpatch.pl. drivers/net/ethernet/renesas/sh_eth.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 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: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -2675,6 +2675,7 @@ static int sh_eth_drv_remove(struct plat return 0; } +#ifdef CONFIG_PM static int sh_eth_runtime_nop(struct device *dev) { /* @@ -2688,17 +2689,21 @@ static int sh_eth_runtime_nop(struct dev return 0; } -static struct dev_pm_ops sh_eth_dev_pm_ops = { +static const struct dev_pm_ops sh_eth_dev_pm_ops = { .runtime_suspend = sh_eth_runtime_nop, .runtime_resume = sh_eth_runtime_nop, }; +#define SH_ETH_PM_OPS (&sh_eth_dev_pm_ops) +#else +#define SH_ETH_PM_OPS NULL +#endif static struct platform_driver sh_eth_driver = { .probe = sh_eth_drv_probe, .remove = sh_eth_drv_remove, .driver = { .name = CARDNAME, - .pm = &sh_eth_dev_pm_ops, + .pm = SH_ETH_PM_OPS, }, };