All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Mark Brown <broonie@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v2 6/6] memory: renesas-rpc-if: Remove Runtime PM wrappers
Date: Wed, 23 Nov 2022 15:41:22 +0100	[thread overview]
Message-ID: <d87aa5d7e4a39b18f7e2e0649fee0a45b45d371f.1669213027.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1669213027.git.geert+renesas@glider.be>

Now the rpcif_{en,dis}able_rpm() wrappers just take a pointer to a
device structure, there is no point in keeping them.  Remove them, and
update the callers to call Runtime PM directly.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This could be split in three patches for three different subsystems,
with the changes to <memory/renesas-rpc-if.h> postponed, to relax
dependencies, but the previous patch already touches all three
subsystems anyway.

v2:
  - New.
---
 drivers/mtd/hyperbus/rpc-if.c   |  6 +++---
 drivers/spi/spi-rpc-if.c        |  6 +++---
 include/memory/renesas-rpc-if.h | 10 ----------
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c
index 41734e337ac00e40..ef32fca5f785e376 100644
--- a/drivers/mtd/hyperbus/rpc-if.c
+++ b/drivers/mtd/hyperbus/rpc-if.c
@@ -130,7 +130,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, hyperbus);
 
-	rpcif_enable_rpm(hyperbus->rpc.dev);
+	pm_runtime_enable(hyperbus->rpc.dev);
 
 	error = rpcif_hw_init(hyperbus->rpc.dev, true);
 	if (error)
@@ -150,7 +150,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
 	return 0;
 
 out_disable_rpm:
-	rpcif_disable_rpm(hyperbus->rpc.dev);
+	pm_runtime_disable(hyperbus->rpc.dev);
 	return error;
 }
 
@@ -160,7 +160,7 @@ static int rpcif_hb_remove(struct platform_device *pdev)
 
 	hyperbus_unregister_device(&hyperbus->hbdev);
 
-	rpcif_disable_rpm(hyperbus->rpc.dev);
+	pm_runtime_disable(hyperbus->rpc.dev);
 
 	return 0;
 }
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index 5063587d2c724c7c..ec0904faf3a10bd0 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -147,7 +147,7 @@ static int rpcif_spi_probe(struct platform_device *pdev)
 
 	ctlr->dev.of_node = parent->of_node;
 
-	rpcif_enable_rpm(rpc->dev);
+	pm_runtime_enable(rpc->dev);
 
 	ctlr->num_chipselect = 1;
 	ctlr->mem_ops = &rpcif_spi_mem_ops;
@@ -169,7 +169,7 @@ static int rpcif_spi_probe(struct platform_device *pdev)
 	return 0;
 
 out_disable_rpm:
-	rpcif_disable_rpm(rpc->dev);
+	pm_runtime_disable(rpc->dev);
 	return error;
 }
 
@@ -179,7 +179,7 @@ static int rpcif_spi_remove(struct platform_device *pdev)
 	struct rpcif *rpc = spi_controller_get_devdata(ctlr);
 
 	spi_unregister_controller(ctlr);
-	rpcif_disable_rpm(rpc->dev);
+	pm_runtime_disable(rpc->dev);
 
 	return 0;
 }
diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h
index 86a26ea78221a204..b8fa30fd6b500c73 100644
--- a/include/memory/renesas-rpc-if.h
+++ b/include/memory/renesas-rpc-if.h
@@ -76,14 +76,4 @@ void rpcif_prepare(struct device *dev, const struct rpcif_op *op, u64 *offs,
 int rpcif_manual_xfer(struct device *dev);
 ssize_t rpcif_dirmap_read(struct device *dev, u64 offs, size_t len, void *buf);
 
-static inline void rpcif_enable_rpm(struct device *dev)
-{
-	pm_runtime_enable(dev);
-}
-
-static inline void rpcif_disable_rpm(struct device *dev)
-{
-	pm_runtime_disable(dev);
-}
-
 #endif // __RENESAS_RPC_IF_H
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Mark Brown <broonie@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>,
	Sergey Shtylyov <s.shtylyov@omp.ru>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH v2 6/6] memory: renesas-rpc-if: Remove Runtime PM wrappers
Date: Wed, 23 Nov 2022 15:41:22 +0100	[thread overview]
Message-ID: <d87aa5d7e4a39b18f7e2e0649fee0a45b45d371f.1669213027.git.geert+renesas@glider.be> (raw)
In-Reply-To: <cover.1669213027.git.geert+renesas@glider.be>

Now the rpcif_{en,dis}able_rpm() wrappers just take a pointer to a
device structure, there is no point in keeping them.  Remove them, and
update the callers to call Runtime PM directly.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This could be split in three patches for three different subsystems,
with the changes to <memory/renesas-rpc-if.h> postponed, to relax
dependencies, but the previous patch already touches all three
subsystems anyway.

v2:
  - New.
---
 drivers/mtd/hyperbus/rpc-if.c   |  6 +++---
 drivers/spi/spi-rpc-if.c        |  6 +++---
 include/memory/renesas-rpc-if.h | 10 ----------
 3 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c
index 41734e337ac00e40..ef32fca5f785e376 100644
--- a/drivers/mtd/hyperbus/rpc-if.c
+++ b/drivers/mtd/hyperbus/rpc-if.c
@@ -130,7 +130,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, hyperbus);
 
-	rpcif_enable_rpm(hyperbus->rpc.dev);
+	pm_runtime_enable(hyperbus->rpc.dev);
 
 	error = rpcif_hw_init(hyperbus->rpc.dev, true);
 	if (error)
@@ -150,7 +150,7 @@ static int rpcif_hb_probe(struct platform_device *pdev)
 	return 0;
 
 out_disable_rpm:
-	rpcif_disable_rpm(hyperbus->rpc.dev);
+	pm_runtime_disable(hyperbus->rpc.dev);
 	return error;
 }
 
@@ -160,7 +160,7 @@ static int rpcif_hb_remove(struct platform_device *pdev)
 
 	hyperbus_unregister_device(&hyperbus->hbdev);
 
-	rpcif_disable_rpm(hyperbus->rpc.dev);
+	pm_runtime_disable(hyperbus->rpc.dev);
 
 	return 0;
 }
diff --git a/drivers/spi/spi-rpc-if.c b/drivers/spi/spi-rpc-if.c
index 5063587d2c724c7c..ec0904faf3a10bd0 100644
--- a/drivers/spi/spi-rpc-if.c
+++ b/drivers/spi/spi-rpc-if.c
@@ -147,7 +147,7 @@ static int rpcif_spi_probe(struct platform_device *pdev)
 
 	ctlr->dev.of_node = parent->of_node;
 
-	rpcif_enable_rpm(rpc->dev);
+	pm_runtime_enable(rpc->dev);
 
 	ctlr->num_chipselect = 1;
 	ctlr->mem_ops = &rpcif_spi_mem_ops;
@@ -169,7 +169,7 @@ static int rpcif_spi_probe(struct platform_device *pdev)
 	return 0;
 
 out_disable_rpm:
-	rpcif_disable_rpm(rpc->dev);
+	pm_runtime_disable(rpc->dev);
 	return error;
 }
 
@@ -179,7 +179,7 @@ static int rpcif_spi_remove(struct platform_device *pdev)
 	struct rpcif *rpc = spi_controller_get_devdata(ctlr);
 
 	spi_unregister_controller(ctlr);
-	rpcif_disable_rpm(rpc->dev);
+	pm_runtime_disable(rpc->dev);
 
 	return 0;
 }
diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h
index 86a26ea78221a204..b8fa30fd6b500c73 100644
--- a/include/memory/renesas-rpc-if.h
+++ b/include/memory/renesas-rpc-if.h
@@ -76,14 +76,4 @@ void rpcif_prepare(struct device *dev, const struct rpcif_op *op, u64 *offs,
 int rpcif_manual_xfer(struct device *dev);
 ssize_t rpcif_dirmap_read(struct device *dev, u64 offs, size_t len, void *buf);
 
-static inline void rpcif_enable_rpm(struct device *dev)
-{
-	pm_runtime_enable(dev);
-}
-
-static inline void rpcif_disable_rpm(struct device *dev)
-{
-	pm_runtime_disable(dev);
-}
-
 #endif // __RENESAS_RPC_IF_H
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2022-11-23 14:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 14:41 [PATCH v2 0/6] memory: renesas-rpc-if: Rebind fixes and misc cleanups Geert Uytterhoeven
2022-11-23 14:41 ` Geert Uytterhoeven
2022-11-23 14:41 ` [PATCH v2 1/6] memory: renesas-rpc-if: Split-off private data from struct rpcif Geert Uytterhoeven
2022-11-23 14:41   ` Geert Uytterhoeven
2022-11-23 14:41 ` [PATCH v2 2/6] memory: renesas-rpc-if: Move resource acquisition to .probe() Geert Uytterhoeven
2022-11-23 14:41   ` Geert Uytterhoeven
2022-11-23 14:41 ` [PATCH v2 3/6] memory: renesas-rpc-if: Always use dev in rpcif_probe() Geert Uytterhoeven
2022-11-23 14:41   ` Geert Uytterhoeven
2022-11-23 14:41 ` [PATCH v2 4/6] memory: renesas-rpc-if: Improve Runtime PM handling Geert Uytterhoeven
2022-11-23 14:41   ` Geert Uytterhoeven
2022-11-23 14:41 ` [PATCH v2 5/6] memory: renesas-rpc-if: Pass device instead of rpcif to rpcif_*() Geert Uytterhoeven
2022-11-23 14:41   ` Geert Uytterhoeven
2022-11-23 14:43   ` Mark Brown
2022-11-23 14:43     ` Mark Brown
2022-11-23 14:41 ` Geert Uytterhoeven [this message]
2022-11-23 14:41   ` [PATCH v2 6/6] memory: renesas-rpc-if: Remove Runtime PM wrappers Geert Uytterhoeven
2022-11-27 21:31 ` [PATCH v2 0/6] memory: renesas-rpc-if: Rebind fixes and misc cleanups Krzysztof Kozlowski
2022-11-27 21:31   ` Krzysztof Kozlowski
2022-11-27 21:34   ` Krzysztof Kozlowski
2022-11-27 21:34     ` Krzysztof Kozlowski
2022-11-28  7:37     ` Geert Uytterhoeven
2022-11-28  7:37       ` Geert Uytterhoeven
2022-12-05  8:56 ` Wolfram Sang
2022-12-05  8:56   ` Wolfram Sang
2022-12-27  8:59 ` Krzysztof Kozlowski
2022-12-27  8:59   ` Krzysztof Kozlowski
2022-12-27  9:06   ` Krzysztof Kozlowski
2022-12-27  9:06     ` Krzysztof Kozlowski
2022-12-27  9:09     ` Geert Uytterhoeven
2022-12-27  9:09       ` Geert Uytterhoeven

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=d87aa5d7e4a39b18f7e2e0649fee0a45b45d371f.1669213027.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.zabel@pengutronix.de \
    --cc=richard@nod.at \
    --cc=s.shtylyov@omp.ru \
    --cc=vigneshr@ti.com \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.