From patchwork Thu Jun 6 19:52:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2683381 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 93AEEDFE86 for ; Thu, 6 Jun 2013 19:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392Ab3FFTwf (ORCPT ); Thu, 6 Jun 2013 15:52:35 -0400 Received: from mail-la0-f47.google.com ([209.85.215.47]:34291 "EHLO mail-la0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753194Ab3FFTwd (ORCPT ); Thu, 6 Jun 2013 15:52:33 -0400 Received: by mail-la0-f47.google.com with SMTP id fe20so2988323lab.34 for ; Thu, 06 Jun 2013 12:52:31 -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=ZsVzZsV6f4GoXl+4N9M4tkH8ilD/4wCU7RpSb3kp8H8=; b=XgFG8LpdVUq+bV5Yit3ztDWh1eYlP/FciVJBMrLENw74eGixYEpGK4MJY6j9w8Mj/A dIuYpXyomLvcY1ki5fFkkvYKYHPQqZOGDa1Lz+VJRriqcykjkZQan+lPC6Z9cEO2NR8G jIl/NX7eBbdfw5TsUuQFAC2FUfAMnbq+FwdCDQfGfuGfhuzyG08s6Aq8P2QCvxMBeUrw lY+X6TJbjpo3fABPyDmCCtcjRcgkqW/NEetkBV/DjY4mTfe00BX3T/FhuVqxFJwEvRsj O4uk29Fuiiennm0eXao3fT9gQcYgTppGbFZcs7x06coyMh1a29CPeWxNogIVEkFJxdpN XPKA== X-Received: by 10.112.171.106 with SMTP id at10mr569141lbc.81.1370548351723; Thu, 06 Jun 2013 12:52:31 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-148-37.pppoe.mtu-net.ru. [91.76.148.37]) by mx.google.com with ESMTPSA id p16sm2669206lbi.13.2013.06.06.12.52.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 06 Jun 2013 12:52:30 -0700 (PDT) From: Sergei Shtylyov Organization: Cogent Embedded To: netdev@vger.kernel.org Subject: [PATCH v5 8/8] sh_eth: enclose PM code into #ifdef CONFIG_PM Date: Thu, 6 Jun 2013 23:52:37 +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: <201306062339.21353.sergei.shtylyov@cogentembedded.com> In-Reply-To: <201306062339.21353.sergei.shtylyov@cogentembedded.com> MIME-Version: 1.0 Message-Id: <201306062352.38151.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQk9Xq72YIDXD/NeWYGxC/UjaVxTZDUVc4GH2iNBAGJqb9un0pSHoshVO/Sj08DKJaWuS9oY 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 5: -refreshed the patch. 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 @@ -2673,6 +2673,7 @@ static int sh_eth_drv_remove(struct plat return 0; } +#ifdef CONFIG_PM static int sh_eth_runtime_nop(struct device *dev) { /* @@ -2686,17 +2687,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, }, };