Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
pmdomain: mediatek: Use devm_platform_ioremap_resource() in init_scp()
Browse files Browse the repository at this point in the history
A wrapper function is available since the commit 7945f92
("drivers: provide devm_platform_ioremap_resource()").

* Thus reuse existing functionality instead of keeping duplicate source code.

* Delete a local variable which became unnecessary with this refactoring.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Ulf Hansson <[email protected]>
  • Loading branch information
elfring authored and storulf committed Feb 14, 2024
1 parent ce816e0 commit a0691f2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pmdomain/mediatek/mtk-scpsys.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ static struct scp *init_scp(struct platform_device *pdev,
bool bus_prot_reg_update)
{
struct genpd_onecell_data *pd_data;
struct resource *res;
int i, j;
struct scp *scp;
struct clk *clk[CLK_MAX];
Expand All @@ -441,8 +440,7 @@ static struct scp *init_scp(struct platform_device *pdev,

scp->dev = &pdev->dev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
scp->base = devm_ioremap_resource(&pdev->dev, res);
scp->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(scp->base))
return ERR_CAST(scp->base);

Expand Down

0 comments on commit a0691f2

Please sign in to comment.