From: wsa+renesas@sang-engineering.com (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] dmaengine: ste_dma40: simplify getting .drvdata
Date: Sun, 22 Apr 2018 11:14:13 +0200 [thread overview]
Message-ID: <20180422091415.7587-6-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20180422091415.7587-1-wsa+renesas@sang-engineering.com>
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
Build tested only. buildbot is happy. Please apply to your tree directly.
drivers/dma/ste_dma40.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index c2b089af0420..1bc149af990e 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2889,8 +2889,7 @@ static int __init d40_dmaengine_init(struct d40_base *base,
#ifdef CONFIG_PM_SLEEP
static int dma40_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct d40_base *base = platform_get_drvdata(pdev);
+ struct d40_base *base = dev_get_drvdata(dev);
int ret;
ret = pm_runtime_force_suspend(dev);
@@ -2904,8 +2903,7 @@ static int dma40_suspend(struct device *dev)
static int dma40_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct d40_base *base = platform_get_drvdata(pdev);
+ struct d40_base *base = dev_get_drvdata(dev);
int ret = 0;
if (base->lcpa_regulator) {
@@ -2970,8 +2968,7 @@ static void d40_save_restore_registers(struct d40_base *base, bool save)
static int dma40_runtime_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct d40_base *base = platform_get_drvdata(pdev);
+ struct d40_base *base = dev_get_drvdata(dev);
d40_save_restore_registers(base, true);
@@ -2985,8 +2982,7 @@ static int dma40_runtime_suspend(struct device *dev)
static int dma40_runtime_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct d40_base *base = platform_get_drvdata(pdev);
+ struct d40_base *base = dev_get_drvdata(dev);
d40_save_restore_registers(base, false);
--
2.11.0
next prev parent reply other threads:[~2018-04-22 9:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-22 9:14 [PATCH 0/6] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-22 9:14 ` [PATCH 1/6] dmaengine: at_hdmac: " Wolfram Sang
2018-04-23 5:46 ` Ludovic Desroches
2018-04-22 9:14 ` [PATCH 2/6] dmaengine: at_xdmac: " Wolfram Sang
2018-04-23 5:46 ` Ludovic Desroches
2018-04-22 9:14 ` Wolfram Sang [this message]
2018-04-22 16:11 ` [PATCH 0/6] tree-wide: " Vinod Koul
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=20180422091415.7587-6-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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).