linux-sunxi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-08  7:17 Cai Huoqing
  2021-09-08  7:38 ` Maxime Ripard
  0 siblings, 1 reply; 3+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:17 UTC (permalink / raw)
  To: caihuoqing
  Cc: Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, linux-arm-kernel,
	linux-sunxi, linux-kernel

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/soc/sunxi/sunxi_sram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 42833e33a96c..a8f3876963a0 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -331,7 +331,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
 
 static int sunxi_sram_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct dentry *d;
 	struct regmap *emac_clock;
 	const struct sunxi_sramc_variant *variant;
@@ -342,8 +341,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)
 	if (!variant)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:17 [PATCH] soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-08  7:38 ` Maxime Ripard
  0 siblings, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2021-09-08  7:38 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Chen-Yu Tsai, Jernej Skrabec, linux-arm-kernel, linux-sunxi,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

On Wed, Sep 08, 2021 at 03:17:15PM +0800, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>

Applied, thanks
Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-08  7:11 [PATCH 1/2] soc: amlogic: canvas: " Cai Huoqing
@ 2021-09-08  7:11 ` Cai Huoqing
  0 siblings, 0 replies; 3+ messages in thread
From: Cai Huoqing @ 2021-09-08  7:11 UTC (permalink / raw)
  To: caihuoqing
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	Rafał Miłecki, Florian Fainelli,
	bcm-kernel-feedback-list, Li Yang, Krzysztof Halasa,
	Matthias Brugger, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec,
	Thierry Reding, Jonathan Hunter, Santosh Shilimkar,
	Nishanth Menon, linux-arm-kernel, linux-amlogic, linux-kernel,
	linux-pm, linux-mips, linuxppc-dev, linux-mediatek, linux-sunxi,
	linux-tegra

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/soc/sunxi/sunxi_sram.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c
index 42833e33a96c..a8f3876963a0 100644
--- a/drivers/soc/sunxi/sunxi_sram.c
+++ b/drivers/soc/sunxi/sunxi_sram.c
@@ -331,7 +331,6 @@ static struct regmap_config sunxi_sram_emac_clock_regmap = {
 
 static int sunxi_sram_probe(struct platform_device *pdev)
 {
-	struct resource *res;
 	struct dentry *d;
 	struct regmap *emac_clock;
 	const struct sunxi_sramc_variant *variant;
@@ -342,8 +341,7 @@ static int sunxi_sram_probe(struct platform_device *pdev)
 	if (!variant)
 		return -EINVAL;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	base = devm_ioremap_resource(&pdev->dev, res);
+	base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(base))
 		return PTR_ERR(base);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-08  7:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  7:17 [PATCH] soc: sunxi_sram: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-08  7:38 ` Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2021-09-08  7:11 [PATCH 1/2] soc: amlogic: canvas: " Cai Huoqing
2021-09-08  7:11 ` [PATCH] soc: sunxi_sram: " Cai Huoqing

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).