--- zzzz-none-000/linux-3.10.107/drivers/watchdog/advantechwdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/advantechwdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -238,7 +238,7 @@ * Init & exit routines */ -static int advwdt_probe(struct platform_device *dev) +static int __init advwdt_probe(struct platform_device *dev) { int ret; @@ -299,11 +299,9 @@ } static struct platform_driver advwdt_driver = { - .probe = advwdt_probe, .remove = advwdt_remove, .shutdown = advwdt_shutdown, .driver = { - .owner = THIS_MODULE, .name = DRV_NAME, }, }; @@ -314,21 +312,19 @@ pr_info("WDT driver for Advantech single board computer initialising\n"); - err = platform_driver_register(&advwdt_driver); - if (err) - return err; - advwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(advwdt_platform_device)) { - err = PTR_ERR(advwdt_platform_device); - goto unreg_platform_driver; - } + if (IS_ERR(advwdt_platform_device)) + return PTR_ERR(advwdt_platform_device); + + err = platform_driver_probe(&advwdt_driver, advwdt_probe); + if (err) + goto unreg_platform_device; return 0; -unreg_platform_driver: - platform_driver_unregister(&advwdt_driver); +unreg_platform_device: + platform_device_unregister(advwdt_platform_device); return err; } @@ -345,4 +341,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Marek Michalkiewicz "); MODULE_DESCRIPTION("Advantech Single Board Computer WDT driver"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);