From: Soren Brinkmann <soren.brinkmann@xilinx.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>,
David Miller <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
"Michal Simek" <michal.simek@xilinx.com>
Subject: [PATCH v2 1/5] net: macb: Migrate to dev_pm_ops
Date: Tue, 10 Dec 2013 16:07:19 -0800 [thread overview]
Message-ID: <1386720443-24100-2-git-send-email-soren.brinkmann@xilinx.com> (raw)
In-Reply-To: <1386720443-24100-1-git-send-email-soren.brinkmann@xilinx.com>
Migrate the suspend/resume functions to use the dev_pm_ops PM interface.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
drivers/net/ethernet/cadence/macb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 92578690f6de..389ccf1362d5 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1946,8 +1946,9 @@ static int __exit macb_remove(struct platform_device *pdev)
}
#ifdef CONFIG_PM
-static int macb_suspend(struct platform_device *pdev, pm_message_t state)
+static int macb_suspend(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev);
@@ -1960,8 +1961,9 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int macb_resume(struct platform_device *pdev)
+static int macb_resume(struct device *dev)
{
+ struct platform_device *pdev = to_platform_device(dev);
struct net_device *netdev = platform_get_drvdata(pdev);
struct macb *bp = netdev_priv(netdev);
@@ -1972,19 +1974,17 @@ static int macb_resume(struct platform_device *pdev)
return 0;
}
-#else
-#define macb_suspend NULL
-#define macb_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(macb_pm_ops, macb_suspend, macb_resume);
+
static struct platform_driver macb_driver = {
.remove = __exit_p(macb_remove),
- .suspend = macb_suspend,
- .resume = macb_resume,
.driver = {
.name = "macb",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(macb_dt_ids),
+ .pm = &macb_pm_ops,
},
};
--
1.8.5.1
next prev parent reply other threads:[~2013-12-11 0:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-11 0:07 [PATCH v2 0/5] net: macb updates Soren Brinkmann
2013-12-11 0:07 ` Soren Brinkmann [this message]
2013-12-11 0:07 ` [PATCH v2 2/5] net: macb: Migrate to devm clock interface Soren Brinkmann
2013-12-11 0:07 ` [PATCH v2 3/5] net: macb: Use devm_ioremap() Soren Brinkmann
2013-12-11 0:07 ` [PATCH v2 4/5] net: macb: Use devm_request_irq() Soren Brinkmann
2013-12-11 0:07 ` [PATCH v2 5/5] net: macb: Adjust tx_clk when link speed changes Soren Brinkmann
2013-12-11 3:57 ` [PATCH v2 0/5] net: macb updates David Miller
2013-12-12 7:00 ` Olof Johansson
2013-12-12 14:28 ` Nicolas Ferre
2013-12-12 16:00 ` [PATCH] ARM: at91: remove AT91_PROGRAMMABLE_CLOCKS configuration option Nicolas Ferre
2013-12-12 18:38 ` Kevin Hilman
2013-12-13 15:18 ` Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386720443-24100-2-git-send-email-soren.brinkmann@xilinx.com \
--to=soren.brinkmann@xilinx.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).