]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: mtd-sd: use devm_platform_ioremap_resource
authorRosen Penev <rosenp@gmail.com>
Mon, 30 Sep 2024 22:49:18 +0000 (15:49 -0700)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 14 Oct 2024 10:40:10 +0000 (12:40 +0200)
My guess is some automated tool missed this transformation. Now looks
clearer as do what's happening. Also allows removal of struct resource.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://lore.kernel.org/r/20240930224919.355359-3-rosenp@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/mtk-sd.c

index b9b4a832a15fbb5c9c4ae0f9872774c1ae539bdf..41ad650a6d1c0dff8f03f9346a89b646e2eed8c4 100644 (file)
@@ -2752,7 +2752,6 @@ static int msdc_drv_probe(struct platform_device *pdev)
 {
        struct mmc_host *mmc;
        struct msdc_host *host;
-       struct resource *res;
        int ret;
 
        if (!pdev->dev.of_node) {
@@ -2774,12 +2773,9 @@ static int msdc_drv_probe(struct platform_device *pdev)
        if (IS_ERR(host->base))
                return PTR_ERR(host->base);
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-       if (res) {
-               host->top_base = devm_ioremap_resource(&pdev->dev, res);
-               if (IS_ERR(host->top_base))
-                       host->top_base = NULL;
-       }
+       host->top_base = devm_platform_ioremap_resource(pdev, 1);
+       if (IS_ERR(host->top_base))
+               host->top_base = NULL;
 
        ret = mmc_regulator_get_supply(mmc);
        if (ret)