Skip to content

Commit

Permalink
soc: loongson: loongson2_guts: Convert to devm_platform_ioremap_resou…
Browse files Browse the repository at this point in the history
…rce()

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Dongliang Mu <dzm91@hust.edu.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Dongliang Mu authored and Arnd Bergmann committed Sep 27, 2023
1 parent a2fd542 commit daacef8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/soc/loongson/loongson2_guts.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ static int loongson2_guts_probe(struct platform_device *pdev)
{
struct device_node *root, *np = pdev->dev.of_node;
struct device *dev = &pdev->dev;
struct resource *res;
const struct loongson2_soc_die_attr *soc_die;
const char *machine;
u32 svr;
Expand All @@ -106,8 +105,7 @@ static int loongson2_guts_probe(struct platform_device *pdev)

guts->little_endian = of_property_read_bool(np, "little-endian");

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
guts->regs = ioremap(res->start, res->end - res->start + 1);
guts->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(guts->regs))
return PTR_ERR(guts->regs);

Expand Down

0 comments on commit daacef8

Please sign in to comment.