Skip to content

Commit 21ec867

Browse files
YueHaibingbebarino
authored andcommitted
clk: axs10x: use devm_platform_ioremap_resource() to simplify code
Use devm_platform_ioremap_resource() to simplify the code a bit. This is detected by coccinelle. Signed-off-by: YueHaibing <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Stephen Boyd <[email protected]>
1 parent 0b17159 commit 21ec867

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

drivers/clk/axs10x/i2s_pll_clock.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,12 @@ static int i2s_pll_clk_probe(struct platform_device *pdev)
172172
struct clk *clk;
173173
struct i2s_pll_clk *pll_clk;
174174
struct clk_init_data init;
175-
struct resource *mem;
176175

177176
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
178177
if (!pll_clk)
179178
return -ENOMEM;
180179

181-
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
182-
pll_clk->base = devm_ioremap_resource(dev, mem);
180+
pll_clk->base = devm_platform_ioremap_resource(pdev, 0);
183181
if (IS_ERR(pll_clk->base))
184182
return PTR_ERR(pll_clk->base);
185183

drivers/clk/axs10x/pll_clock.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,21 +221,18 @@ static int axs10x_pll_clk_probe(struct platform_device *pdev)
221221
struct device *dev = &pdev->dev;
222222
const char *parent_name;
223223
struct axs10x_pll_clk *pll_clk;
224-
struct resource *mem;
225224
struct clk_init_data init = { };
226225
int ret;
227226

228227
pll_clk = devm_kzalloc(dev, sizeof(*pll_clk), GFP_KERNEL);
229228
if (!pll_clk)
230229
return -ENOMEM;
231230

232-
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
233-
pll_clk->base = devm_ioremap_resource(dev, mem);
231+
pll_clk->base = devm_platform_ioremap_resource(pdev, 0);
234232
if (IS_ERR(pll_clk->base))
235233
return PTR_ERR(pll_clk->base);
236234

237-
mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
238-
pll_clk->lock = devm_ioremap_resource(dev, mem);
235+
pll_clk->lock = devm_platform_ioremap_resource(pdev, 1);
239236
if (IS_ERR(pll_clk->lock))
240237
return PTR_ERR(pll_clk->lock);
241238

0 commit comments

Comments
 (0)