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: 45217 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 866BA204BC for ; Fri, 27 Feb 2015 11:20:06 +0000 (UTC) Received: by labge10 with SMTP id ge10sf13754641lab.3 for ; Fri, 27 Feb 2015 03:20:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=9oBhBJ0WSnuIhGxjXcAfEtUo1JLi4mAQutyLWZ7l69o=; b=c5AEQTGZxM0HU6DnmH3YrJ0qRwYMls1mzPO0ggJ2vqqPCK+yS4qXtcw6nPsjxY34Ii W6z1vddQUfYiKId6WZvzvRkFOMkR8od2BPqxGbcalv0AtfZ5pOf9LpPKYQyvNRfUu4YN Aondh0wPdHJhPSo3upCH77TnRcMUnyR/YFNWCP7+wWHCFnNFfnBlYW6JiEezGCxj4BYu I/0SZLa6XCr8EH5eXtTrBX5zd89G1klUvIwHVDkthv4DG0WzVBh0QVZPd4c3t+xaQ7C2 fzdJlErw9/6d768ljN+cN+hXzxK4JYoW10ffYCM6+QeUzF04t1q21/E8EQWai/04olE3 Ixyg== X-Gm-Message-State: ALoCoQn9S5wiPLjAJIfcgBEve+zSHw2c5BzuVUXPArPLQTHuaUf7Nr+LqQrHG2MXtNYg0PFtHPCo X-Received: by 10.112.35.135 with SMTP id h7mr1972288lbj.23.1425036005461; Fri, 27 Feb 2015 03:20:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.84 with SMTP id be20ls165526lab.89.gmail; Fri, 27 Feb 2015 03:20:05 -0800 (PST) X-Received: by 10.152.7.162 with SMTP id k2mr11604554laa.92.1425036005284; Fri, 27 Feb 2015 03:20:05 -0800 (PST) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id uq11si2619013lac.159.2015.02.27.03.20.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 03:20:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lams18 with SMTP id s18so16833775lam.11 for ; Fri, 27 Feb 2015 03:20:05 -0800 (PST) X-Received: by 10.152.88.4 with SMTP id bc4mr12011948lab.86.1425036005136; Fri, 27 Feb 2015 03:20:05 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp3868580lbj; Fri, 27 Feb 2015 03:20:04 -0800 (PST) X-Received: by 10.70.40.209 with SMTP id z17mr23397816pdk.9.1425036003301; Fri, 27 Feb 2015 03:20:03 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id er10si5062491pac.123.2015.02.27.03.20.01; Fri, 27 Feb 2015 03:20:03 -0800 (PST) Received-SPF: none (google.com: netdev-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753190AbbB0LT4 (ORCPT + 3 others); Fri, 27 Feb 2015 06:19:56 -0500 Received: from mail-lb0-f175.google.com ([209.85.217.175]:43866 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752605AbbB0LTy (ORCPT ); Fri, 27 Feb 2015 06:19:54 -0500 Received: by lbiw7 with SMTP id w7so16590849lbi.10 for ; Fri, 27 Feb 2015 03:19:53 -0800 (PST) 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: netdev-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: netdev@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: grygorii.strashko@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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", },