Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: ebc-c384_wdt: Utilize the ISA bus driver

The WinSystems EBC-C384 watchdog timer is controlled via ISA bus
communication. As such, the ISA bus driver is more appropriate than the
platform driver for the WinSystems EBC-C384 watchdog timer driver.

Cc: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

William Breathitt Gray and committed by
Greg Kroah-Hartman
4ef1bec4 9c2cfc19

+11 -34
+1 -1
drivers/watchdog/Kconfig
··· 738 738 739 739 config EBC_C384_WDT 740 740 tristate "WinSystems EBC-C384 Watchdog Timer" 741 - depends on X86 741 + depends on X86 && ISA 742 742 select WATCHDOG_CORE 743 743 help 744 744 Enables watchdog timer support for the watchdog timer on the
+10 -33
drivers/watchdog/ebc-c384_wdt.c
··· 16 16 #include <linux/errno.h> 17 17 #include <linux/io.h> 18 18 #include <linux/ioport.h> 19 + #include <linux/isa.h> 19 20 #include <linux/kernel.h> 20 21 #include <linux/module.h> 21 22 #include <linux/moduleparam.h> 22 - #include <linux/platform_device.h> 23 23 #include <linux/types.h> 24 24 #include <linux/watchdog.h> 25 25 ··· 95 95 .identity = MODULE_NAME 96 96 }; 97 97 98 - static int __init ebc_c384_wdt_probe(struct platform_device *pdev) 98 + static int ebc_c384_wdt_probe(struct device *dev, unsigned int id) 99 99 { 100 - struct device *dev = &pdev->dev; 101 100 struct watchdog_device *wdd; 102 101 103 102 if (!devm_request_region(dev, BASE_ADDR, ADDR_EXTENT, dev_name(dev))) { ··· 121 122 dev_warn(dev, "Invalid timeout (%u seconds), using default (%u seconds)\n", 122 123 timeout, WATCHDOG_TIMEOUT); 123 124 124 - platform_set_drvdata(pdev, wdd); 125 + dev_set_drvdata(dev, wdd); 125 126 126 127 return watchdog_register_device(wdd); 127 128 } 128 129 129 - static int ebc_c384_wdt_remove(struct platform_device *pdev) 130 + static int ebc_c384_wdt_remove(struct device *dev, unsigned int id) 130 131 { 131 - struct watchdog_device *wdd = platform_get_drvdata(pdev); 132 + struct watchdog_device *wdd = dev_get_drvdata(dev); 132 133 133 134 watchdog_unregister_device(wdd); 134 135 135 136 return 0; 136 137 } 137 138 138 - static struct platform_driver ebc_c384_wdt_driver = { 139 + static struct isa_driver ebc_c384_wdt_driver = { 140 + .probe = ebc_c384_wdt_probe, 139 141 .driver = { 140 142 .name = MODULE_NAME 141 143 }, 142 144 .remove = ebc_c384_wdt_remove 143 145 }; 144 146 145 - static struct platform_device *ebc_c384_wdt_device; 146 - 147 147 static int __init ebc_c384_wdt_init(void) 148 148 { 149 - int err; 150 - 151 149 if (!dmi_match(DMI_BOARD_NAME, "EBC-C384 SBC")) 152 150 return -ENODEV; 153 151 154 - ebc_c384_wdt_device = platform_device_alloc(MODULE_NAME, -1); 155 - if (!ebc_c384_wdt_device) 156 - return -ENOMEM; 157 - 158 - err = platform_device_add(ebc_c384_wdt_device); 159 - if (err) 160 - goto err_platform_device; 161 - 162 - err = platform_driver_probe(&ebc_c384_wdt_driver, ebc_c384_wdt_probe); 163 - if (err) 164 - goto err_platform_driver; 165 - 166 - return 0; 167 - 168 - err_platform_driver: 169 - platform_device_del(ebc_c384_wdt_device); 170 - err_platform_device: 171 - platform_device_put(ebc_c384_wdt_device); 172 - return err; 152 + return isa_register_driver(&ebc_c384_wdt_driver, 1); 173 153 } 174 154 175 155 static void __exit ebc_c384_wdt_exit(void) 176 156 { 177 - platform_device_unregister(ebc_c384_wdt_device); 178 - platform_driver_unregister(&ebc_c384_wdt_driver); 157 + isa_unregister_driver(&ebc_c384_wdt_driver); 179 158 } 180 159 181 160 module_init(ebc_c384_wdt_init); ··· 162 185 MODULE_AUTHOR("William Breathitt Gray <vilhelm.gray@gmail.com>"); 163 186 MODULE_DESCRIPTION("WinSystems EBC-C384 watchdog timer driver"); 164 187 MODULE_LICENSE("GPL v2"); 165 - MODULE_ALIAS("platform:" MODULE_NAME); 188 + MODULE_ALIAS("isa:" MODULE_NAME);