[PATCH linux-next 03/33] clk: mediatek: Drop unused shared_io flag

From: Akari Tsuyukusa

Date: Sat Nov 28 2026 - 20:47:58 EST


No MediaTek clock driver sets shared_io in struct mtk_clk_desc.
Moreover, the of_iomap() path enabled by this flag lacked a
corresponding iounmap() on driver removal, which would cause a
resource leak if it were ever used.

Just drop this flag and its handling.

Signed-off-by: Akari Tsuyukusa <akkun11.open@xxxxxxxxx>
---
drivers/clk/mediatek/clk-mtk.c | 17 +++++------------
drivers/clk/mediatek/clk-mtk.h | 1 -
2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mtk.c b/drivers/clk/mediatek/clk-mtk.c
index 5d8bcd09c9b5..ab1adcb0085f 100644
--- a/drivers/clk/mediatek/clk-mtk.c
+++ b/drivers/clk/mediatek/clk-mtk.c
@@ -11,7 +11,6 @@
#include <linux/mfd/syscon.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
@@ -497,27 +496,24 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,

/* Composite and divider clocks needs us to pass iomem pointer */
if (mcd->composite_clks || mcd->divider_clks) {
- if (!mcd->shared_io)
- base = devm_platform_ioremap_resource(pdev, 0);
- else
- base = of_iomap(node, 0);
+ base = devm_platform_ioremap_resource(pdev, 0);

- if (IS_ERR_OR_NULL(base))
- return IS_ERR(base) ? PTR_ERR(base) : -ENOMEM;
+ if (IS_ERR(base))
+ return PTR_ERR(base);
}


if (mcd->need_runtime_pm) {
r = devm_pm_runtime_enable(&pdev->dev);
if (r)
- goto unmap_io;
+ return r;
/*
* Do a pm_runtime_resume_and_get() to workaround a possible
* deadlock between clk_register() and the genpd framework.
*/
r = pm_runtime_resume_and_get(&pdev->dev);
if (r)
- goto unmap_io;
+ return r;
}

/* Calculate how many clk_hw_onecell_data entries to allocate */
@@ -667,9 +663,6 @@ static int __mtk_clk_simple_probe(struct platform_device *pdev,
free_base:
if (mcd->need_runtime_pm)
pm_runtime_put(&pdev->dev);
-unmap_io:
- if (mcd->shared_io && base)
- iounmap(base);
return r;
}

diff --git a/drivers/clk/mediatek/clk-mtk.h b/drivers/clk/mediatek/clk-mtk.h
index 11939e3e0b38..1628f073eb29 100644
--- a/drivers/clk/mediatek/clk-mtk.h
+++ b/drivers/clk/mediatek/clk-mtk.h
@@ -259,7 +259,6 @@ struct mtk_clk_desc {
size_t num_plls;
const struct mtk_clk_rst_desc *rst_desc;
spinlock_t *clk_lock;
- bool shared_io;

int (*clk_notifier_func)(struct device *dev, struct clk *clk);
unsigned int mfg_clk_idx;
--
2.56.0