--- zzzz-none-000/linux-3.10.107/drivers/watchdog/rc32434_wdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/rc32434_wdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -25,13 +25,13 @@ #include /* For the -ENODEV/... values */ #include /* For printk/panic/... */ #include /* For file operations */ -#include /* For MODULE_ALIAS_MISCDEV - (WATCHDOG_MINOR) */ +#include /* For struct miscdevice */ #include /* For the watchdog specific items */ #include /* For __init/__exit/... */ #include /* For platform_driver framework */ #include /* For spin_lock/spin_unlock/... */ #include /* For copy_to_user/put_user/... */ +#include /* For devm_ioremap_nocache */ #include /* For the Watchdog registers */ @@ -271,7 +271,7 @@ return -ENODEV; } - wdt_reg = ioremap_nocache(r->start, resource_size(r)); + wdt_reg = devm_ioremap_nocache(&pdev->dev, r->start, resource_size(r)); if (!wdt_reg) { pr_err("failed to remap I/O resources\n"); return -ENXIO; @@ -293,23 +293,18 @@ ret = misc_register(&rc32434_wdt_miscdev); if (ret < 0) { pr_err("failed to register watchdog device\n"); - goto unmap; + return ret; } pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", timeout); return 0; - -unmap: - iounmap(wdt_reg); - return ret; } static int rc32434_wdt_remove(struct platform_device *pdev) { misc_deregister(&rc32434_wdt_miscdev); - iounmap(wdt_reg); return 0; } @@ -333,4 +328,3 @@ "Florian Fainelli "); MODULE_DESCRIPTION("Driver for the IDT RC32434 SoC watchdog"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);