From patchwork Fri Feb 27 11:19:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Grygorii.Strashko@linaro.org" X-Patchwork-Id: 5900091 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 11CCC9F38E for ; Fri, 27 Feb 2015 11:20:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 413CC202E5 for ; Fri, 27 Feb 2015 11:20:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65D0620260 for ; Fri, 27 Feb 2015 11:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753080AbbB0LT4 (ORCPT ); Fri, 27 Feb 2015 06:19:56 -0500 Received: from mail-la0-f54.google.com ([209.85.215.54]:46320 "EHLO mail-la0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752936AbbB0LTz (ORCPT ); Fri, 27 Feb 2015 06:19:55 -0500 Received: by lams18 with SMTP id s18so16828815lam.13 for ; Fri, 27 Feb 2015 03:19:53 -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:in-reply-to :references; bh=9QRYUdrtvKvl0eUxowOZiHcLTWvd9fbqu0pgQDALN18=; b=JBjOGePHrpkEzubFlLz1BdPr+vLUJuab61YAnyzDTPC/Vbm2l1/Hf2EMuJTdV+2ueo k9qEypUDWHvjAPjkKaP4TXQk7Ga/nQbMrpFbaUjcfTr/U46atUwEfe3rB2QMfo6YaLl1 m+CtSlPZWSYojbyxoONABCcuyxepCt1YoRGKrHAvSlYByFOAgj/0bCL8151O88LyUhif 0dQeylyYXLagug6tLVUtiAzv+PyFxDYU9zdldeNqRFi+DspGxmBRM9QN4iOBiSB9v8ju HQYd660w2tQs3k9lO3bw3gPdIxz8uGHbjuiLYEqreyKHCodal4dsxsxAJSkjJfVE8enn diyQ== X-Gm-Message-State: ALoCoQk/0Q9B1bAvDOp5UpfIuB19TuDkWl8KQVBO0LfdkWqAtAKwhtltCa4veujKd7KkeXmpydzv X-Received: by 10.152.44.225 with SMTP id h1mr11395831lam.99.1425035993357; Fri, 27 Feb 2015 03:19:53 -0800 (PST) Received: from localhost ([195.238.92.128]) by mx.google.com with ESMTPSA id j7sm777514lbm.9.2015.02.27.03.19.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 27 Feb 2015 03:19:52 -0800 (PST) From: To: "David S. Miller" , Felipe Balbi Cc: , , Mugunthan V N , netdev@vger.kernel.org, , Grygorii Strashko Subject: [PATCH 2/2] net: ti: cpsw: add hibernation callbacks Date: Fri, 27 Feb 2015 13:19:45 +0200 Message-Id: <1425035985-8875-2-git-send-email-grygorii.strashko@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1425035985-8875-1-git-send-email-grygorii.strashko@linaro.org> References: <1425035985-8875-1-git-send-email-grygorii.strashko@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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 From: Grygorii Strashko Setting a dev_pm_ops suspend/resume pair but not a set of hibernation functions means those pm functions will not be called upon hibernation. Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the suspend and hibernation handlers and move cpsw_suspend/resume calbacks under CONFIG_PM_SLEEP to avoid build warnings. Signed-off-by: Grygorii Strashko --- drivers/net/ethernet/ti/cpsw.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 8704954..b4fcf5f 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -2805,6 +2805,7 @@ static int cpsw_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_PM_SLEEP static int cpsw_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -2857,11 +2858,9 @@ static int cpsw_resume(struct device *dev) } return 0; } +#endif -static const struct dev_pm_ops cpsw_pm_ops = { - .suspend = cpsw_suspend, - .resume = cpsw_resume, -}; +static SIMPLE_DEV_PM_OPS(cpsw_pm_ops, cpsw_suspend, cpsw_resume); static const struct of_device_id cpsw_of_mtable[] = { { .compatible = "ti,cpsw", },