--- zzzz-none-000/linux-3.10.107/drivers/watchdog/ib700wdt.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/watchdog/ib700wdt.c 2021-02-04 17:41:59.000000000 +0000 @@ -277,7 +277,7 @@ * Init & exit routines */ -static int ibwdt_probe(struct platform_device *dev) +static int __init ibwdt_probe(struct platform_device *dev) { int res; @@ -336,11 +336,9 @@ } static struct platform_driver ibwdt_driver = { - .probe = ibwdt_probe, .remove = ibwdt_remove, .shutdown = ibwdt_shutdown, .driver = { - .owner = THIS_MODULE, .name = DRV_NAME, }, }; @@ -351,21 +349,19 @@ pr_info("WDT driver for IB700 single board computer initialising\n"); - err = platform_driver_register(&ibwdt_driver); - if (err) - return err; - ibwdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); - if (IS_ERR(ibwdt_platform_device)) { - err = PTR_ERR(ibwdt_platform_device); - goto unreg_platform_driver; - } + if (IS_ERR(ibwdt_platform_device)) + return PTR_ERR(ibwdt_platform_device); + + err = platform_driver_probe(&ibwdt_driver, ibwdt_probe); + if (err) + goto unreg_platform_device; return 0; -unreg_platform_driver: - platform_driver_unregister(&ibwdt_driver); +unreg_platform_device: + platform_device_unregister(ibwdt_platform_device); return err; } @@ -382,6 +378,5 @@ MODULE_AUTHOR("Charles Howes "); MODULE_DESCRIPTION("IB700 SBC watchdog driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); /* end of ib700wdt.c */