From: Yangtao Li <frank.li@vivo.com>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: Yangtao Li <frank.li@vivo.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: [PATCH 09/13] clk: mediatek: Convert to devm_platform_ioremap_resource()
Date: Wed, 5 Jul 2023 14:53:09 +0800 [thread overview]
Message-ID: <20230705065313.67043-9-frank.li@vivo.com> (raw)
In-Reply-To: <20230705065313.67043-1-frank.li@vivo.com>
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
drivers/clk/mediatek/clk-mt2701.c | 6 ++----
drivers/clk/mediatek/clk-mt6765.c | 21 ++++++---------------
2 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/drivers/clk/mediatek/clk-mt2701.c b/drivers/clk/mediatek/clk-mt2701.c
index 4a154da8a543..4269eb37be2f 100644
--- a/drivers/clk/mediatek/clk-mt2701.c
+++ b/drivers/clk/mediatek/clk-mt2701.c
@@ -663,9 +663,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
struct clk_hw_onecell_data *clk_data;
void __iomem *base;
struct device_node *node = pdev->dev.of_node;
- struct resource *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);
@@ -887,9 +886,8 @@ static int mtk_pericfg_init(struct platform_device *pdev)
void __iomem *base;
int r;
struct device_node *node = pdev->dev.of_node;
- struct resource *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);
diff --git a/drivers/clk/mediatek/clk-mt6765.c b/drivers/clk/mediatek/clk-mt6765.c
index 0377e6dd3206..bd957d7c6d54 100644
--- a/drivers/clk/mediatek/clk-mt6765.c
+++ b/drivers/clk/mediatek/clk-mt6765.c
@@ -731,13 +731,10 @@ static int clk_mt6765_apmixed_probe(struct platform_device *pdev)
int r;
struct device_node *node = pdev->dev.of_node;
void __iomem *base;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(base)) {
- pr_err("%s(): ioremap failed\n", __func__);
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
return PTR_ERR(base);
- }
clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
@@ -766,13 +763,10 @@ static int clk_mt6765_top_probe(struct platform_device *pdev)
struct device_node *node = pdev->dev.of_node;
void __iomem *base;
struct clk_hw_onecell_data *clk_data;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(base)) {
- pr_err("%s(): ioremap failed\n", __func__);
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
return PTR_ERR(base);
- }
clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
@@ -807,13 +801,10 @@ static int clk_mt6765_ifr_probe(struct platform_device *pdev)
int r;
struct device_node *node = pdev->dev.of_node;
void __iomem *base;
- struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- base = devm_ioremap_resource(&pdev->dev, res);
- if (IS_ERR(base)) {
- pr_err("%s(): ioremap failed\n", __func__);
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
return PTR_ERR(base);
- }
clk_data = mtk_alloc_clk_data(CLK_IFR_NR_CLK);
--
2.39.0
next prev parent reply other threads:[~2023-07-05 6:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 6:53 [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05 6:53 ` [PATCH 02/13] clk: actions: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-08-22 21:54 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 03/13] clk: axm5516: " Yangtao Li
2023-08-22 21:54 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 04/13] clk: bm1880: " Yangtao Li
2023-08-22 21:54 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 05/13] clk: fsl-sai: " Yangtao Li
2023-08-22 21:53 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 06/13] clk: gemini: " Yangtao Li
2023-08-22 21:53 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 07/13] clk: hsdk-pll: " Yangtao Li
2023-08-22 21:53 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 08/13] clk: imx: clk-imx8qxp-lpcg: " Yangtao Li
2023-07-25 7:30 ` Abel Vesa
2023-07-05 6:53 ` Yangtao Li [this message]
2023-08-22 21:53 ` [PATCH 09/13] clk: mediatek: " Stephen Boyd
2023-07-05 6:53 ` [PATCH 10/13] clk: ti: Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-08-22 21:52 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 11/13] clk: socfpga: agilex: Convert to devm_platform_ioremap_resource() Yangtao Li
2023-08-22 21:52 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 12/13] clk: nuvoton: " Yangtao Li
2023-07-05 7:57 ` Jacky Huang
2023-08-22 21:51 ` Stephen Boyd
2023-07-05 6:53 ` [PATCH 13/13] clk: mvebu: " Yangtao Li
2023-08-22 21:51 ` Stephen Boyd
2023-07-11 18:27 ` [PATCH 01/13] clk: sunxi: sun9i-mmc: Use devm_platform_get_and_ioremap_resource() Jernej Škrabec
2023-07-30 22:44 ` Jernej Škrabec
2023-08-14 10:09 ` Abel Vesa
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=20230705065313.67043-9-frank.li@vivo.com \
--to=frank.li@vivo.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mturquette@baylibre.com \
--cc=sboyd@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
all inboxes | Powered by JetHome®