[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191209195749.868-5-tiny.windzz@gmail.com>
Date: Mon, 9 Dec 2019 19:57:37 +0000
From: Yangtao Li <tiny.windzz@...il.com>
To: afaerber@...e.de, manivannan.sadhasivam@...aro.org,
mturquette@...libre.com, sboyd@...nel.org,
Eugeniy.Paltsev@...opsys.com, shawnguo@...nel.org,
s.hauer@...gutronix.de, kernel@...gutronix.de, festevam@...il.com,
linux-imx@....com, agross@...nel.org, s.nawrocki@...sung.com,
tomasz.figa@...il.com, cw00.choi@...sung.com, kgene@...nel.org,
krzk@...nel.org, palmer@...ive.com, paul.walmsley@...ive.com,
dinguyen@...nel.org, mripard@...nel.org, wens@...e.org,
emilio@...pez.com.ar, pdeschrijver@...dia.com, pgaikwad@...dia.com,
thierry.reding@...il.com, jonathanh@...dia.com,
matthias.bgg@...il.com, rfontana@...hat.com,
gregkh@...uxfoundation.org, t-kristo@...com, john@...ozen.org,
tglx@...utronix.de, allison@...utok.net,
kstewart@...uxfoundation.org, swinslow@...il.com,
aisheng.dong@....com, robh@...nel.org, daniel.baluta@....com,
weiyongjun1@...wei.com, wangyan.wang@...iatek.com,
chunhui.dai@...iatek.com, miquel.raynal@...tlin.com,
heiko@...ech.de, jcmvbkbc@...il.com, nsekhar@...com,
geert+renesas@...der.be
Cc: linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
linux-samsung-soc@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-tegra@...r.kernel.org, linux-mediatek@...ts.infradead.org,
Yangtao Li <tiny.windzz@...il.com>
Subject: [PATCH 05/17] clk: hisilicon: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: Yangtao Li <tiny.windzz@...il.com>
---
drivers/clk/hisilicon/clk-hi3660-stub.c | 6 +-----
drivers/clk/hisilicon/clk.c | 7 +------
2 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/hisilicon/clk-hi3660-stub.c b/drivers/clk/hisilicon/clk-hi3660-stub.c
index 3a653d54bee0..7e44d6e2a307 100644
--- a/drivers/clk/hisilicon/clk-hi3660-stub.c
+++ b/drivers/clk/hisilicon/clk-hi3660-stub.c
@@ -124,7 +124,6 @@ static struct clk_hw *hi3660_stub_clk_hw_get(struct of_phandle_args *clkspec,
static int hi3660_stub_clk_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *res;
unsigned int i;
int ret;
@@ -139,10 +138,7 @@ static int hi3660_stub_clk_probe(struct platform_device *pdev)
if (IS_ERR(stub_clk_chan.mbox))
return PTR_ERR(stub_clk_chan.mbox);
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return -EINVAL;
- freq_reg = devm_ioremap(dev, res->start, resource_size(res));
+ freq_reg = devm_platform_ioremap_resource(pdev, 0);
if (!freq_reg)
return -ENOMEM;
diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index 54d9fdc93599..8c521495d9e5 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -27,18 +27,13 @@ struct hisi_clock_data *hisi_clk_alloc(struct platform_device *pdev,
int nr_clks)
{
struct hisi_clock_data *clk_data;
- struct resource *res;
struct clk **clk_table;
clk_data = devm_kmalloc(&pdev->dev, sizeof(*clk_data), GFP_KERNEL);
if (!clk_data)
return NULL;
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res)
- return NULL;
- clk_data->base = devm_ioremap(&pdev->dev,
- res->start, resource_size(res));
+ clk_data->base = devm_platform_ioremap_resource(pdev, 0);
if (!clk_data->base)
return NULL;
--
2.17.1
Powered by blists - more mailing lists