linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Vinod Koul <vkoul@kernel.org>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	dmaengine@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/9] dmaengine: stm32-dmamux: simplify getting .driver_data
Date: Mon, 20 Sep 2021 11:05:13 +0200	[thread overview]
Message-ID: <20210920090522.23784-2-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20210920090522.23784-1-wsa+renesas@sang-engineering.com>

We should get 'driver_data' 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.

 drivers/dma/stm32-dmamux.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index a42164389ebc..175f06749df6 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -305,8 +305,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int stm32_dmamux_runtime_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 
 	clk_disable_unprepare(stm32_dmamux->clk);
 
@@ -315,13 +314,12 @@ static int stm32_dmamux_runtime_suspend(struct device *dev)
 
 static int stm32_dmamux_runtime_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int ret;
 
 	ret = clk_prepare_enable(stm32_dmamux->clk);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to prepare_enable clock\n");
+		dev_err(dev, "failed to prepare_enable clock\n");
 		return ret;
 	}
 
@@ -332,8 +330,7 @@ static int stm32_dmamux_runtime_resume(struct device *dev)
 #ifdef CONFIG_PM_SLEEP
 static int stm32_dmamux_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int i, ret;
 
 	ret = pm_runtime_resume_and_get(dev);
@@ -353,8 +350,7 @@ static int stm32_dmamux_suspend(struct device *dev)
 
 static int stm32_dmamux_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int i, ret;
 
 	ret = pm_runtime_force_resume(dev);
-- 
2.30.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-09-20  9:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20  9:05 [PATCH 0/9] treewide: simplify getting .driver_data Wolfram Sang
2021-09-20  9:05 ` Wolfram Sang [this message]
2021-09-20  9:05 ` [PATCH 2/9] firmware: meson: " Wolfram Sang
2021-09-20 12:22   ` Neil Armstrong
2021-09-20  9:05 ` [PATCH 3/9] gpio: xilinx: " Wolfram Sang
2021-09-22  9:48   ` Bartosz Golaszewski
2021-09-20  9:05 ` [PATCH 7/9] net: mdio: mdio-bcm-iproc: " Wolfram Sang
2021-09-20 21:56   ` Florian Fainelli
2021-09-21  5:52     ` Wolfram Sang
2021-10-15 17:22 ` [PATCH 0/9] treewide: " Bjorn Andersson

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=20210920090522.23784-2-wsa+renesas@sang-engineering.com \
    --to=wsa+renesas@sang-engineering.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=vkoul@kernel.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).