--- zzzz-none-000/linux-3.10.107/drivers/watchdog/acquirewdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/acquirewdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -60,8 +60,7 @@ #include /* For standard types (like size_t) */ #include /* For the -ENODEV/... values */ #include /* For printk/panic/... */ -#include /* For MODULE_ALIAS_MISCDEV - (WATCHDOG_MINOR) */ +#include /* For struct miscdevice */ #include /* For the watchdog specific items */ #include /* For file operations */ #include /* For io-port access */ @@ -240,7 +239,7 @@ * Init & exit routines */ -static int acq_probe(struct platform_device *dev) +static int __init acq_probe(struct platform_device *dev) { int ret; @@ -292,11 +291,9 @@ } static struct platform_driver acquirewdt_driver = { - .probe = acq_probe, .remove = acq_remove, .shutdown = acq_shutdown, .driver = { - .owner = THIS_MODULE, .name = DRV_NAME, }, }; @@ -307,20 +304,18 @@ pr_info("WDT driver for Acquire single board computer initialising\n"); - err = platform_driver_register(&acquirewdt_driver); - if (err) - return err; - acq_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(acq_platform_device)) { - err = PTR_ERR(acq_platform_device); - goto unreg_platform_driver; - } + if (IS_ERR(acq_platform_device)) + return PTR_ERR(acq_platform_device); + + err = platform_driver_probe(&acquirewdt_driver, acq_probe); + if (err) + goto unreg_platform_device; return 0; -unreg_platform_driver: - platform_driver_unregister(&acquirewdt_driver); +unreg_platform_device: + platform_device_unregister(acq_platform_device); return err; } @@ -337,4 +332,3 @@ MODULE_AUTHOR("David Woodhouse"); MODULE_DESCRIPTION("Acquire Inc. Single Board Computer Watchdog Timer driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);