summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongliang Mu <dzm91@hust.edu.cn>2023-09-01 09:25:48 +0300
committerArnd Bergmann <arnd@arndb.de>2023-09-27 12:05:47 +0300
commitdaacef89cd1bb7e345539db10e979e1b78451591 (patch)
tree25c0794e251fc15624a7560b8ae1c6329d04fa02
parenta2fd542287d02d35d61839a09d4b18ccc4b2ff0e (diff)
downloadlinux-daacef89cd1bb7e345539db10e979e1b78451591.tar.xz
soc: loongson: loongson2_guts: Convert to devm_platform_ioremap_resource()
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>
-rw-r--r--drivers/soc/loongson/loongson2_guts.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/soc/loongson/loongson2_guts.c b/drivers/soc/loongson/loongson2_guts.c
index bace4bc8e03b..d97c77a9a4a2 100644
--- a/drivers/soc/loongson/loongson2_guts.c
+++ b/drivers/soc/loongson/loongson2_guts.c
@@ -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;
@@ -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);