]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
watchdog: iTCO_wdt: Make use of the helper function devm_platform_ioremap_resource()
authorCai Huoqing <caihuoqing@baidu.com>
Tue, 7 Sep 2021 07:42:29 +0000 (15:42 +0800)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Tue, 26 Oct 2021 19:31:09 +0000 (21:31 +0200)
Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210907074230.2757-1-caihuoqing@baidu.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/iTCO_wdt.c

index ced2fc0deb8c4a32cbf005965325ea1a5914985d..16ad2c9842c262ad1b2011dc7829fff402041f5b 100644 (file)
@@ -94,7 +94,6 @@ struct iTCO_wdt_private {
         * NO_REBOOT flag is Memory-Mapped GCS register bit 5 (TCO version 2),
         * or memory-mapped PMC register bit 4 (TCO version 3).
         */
-       struct resource *gcs_pmc_res;
        unsigned long __iomem *gcs_pmc;
        /* the lock for io operations */
        spinlock_t io_lock;
@@ -497,10 +496,7 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
         */
        if (p->iTCO_version >= 2 && p->iTCO_version < 6 &&
            !pdata->no_reboot_use_pmc) {
-               p->gcs_pmc_res = platform_get_resource(pdev,
-                                                      IORESOURCE_MEM,
-                                                      ICH_RES_MEM_GCS_PMC);
-               p->gcs_pmc = devm_ioremap_resource(dev, p->gcs_pmc_res);
+               p->gcs_pmc = devm_platform_ioremap_resource(pdev, ICH_RES_MEM_GCS_PMC);
                if (IS_ERR(p->gcs_pmc))
                        return PTR_ERR(p->gcs_pmc);
        }