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

[WATCHDOG] move platform probe and remove function to devinit and devexit

A pointer to probe and remove functions is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

+14 -14
+3 -3
drivers/watchdog/davinci_wdt.c
··· 193 193 .fops = &davinci_wdt_fops, 194 194 }; 195 195 196 - static int davinci_wdt_probe(struct platform_device *pdev) 196 + static int __devinit davinci_wdt_probe(struct platform_device *pdev) 197 197 { 198 198 int ret = 0, size; 199 199 struct resource *res; ··· 237 237 return ret; 238 238 } 239 239 240 - static int davinci_wdt_remove(struct platform_device *pdev) 240 + static int __devexit davinci_wdt_remove(struct platform_device *pdev) 241 241 { 242 242 misc_deregister(&davinci_wdt_miscdev); 243 243 if (wdt_mem) { ··· 254 254 .owner = THIS_MODULE, 255 255 }, 256 256 .probe = davinci_wdt_probe, 257 - .remove = davinci_wdt_remove, 257 + .remove = __devexit_p(davinci_wdt_remove), 258 258 }; 259 259 260 260 static int __init davinci_wdt_init(void)
+3 -3
drivers/watchdog/mtx-1_wdt.c
··· 206 206 }; 207 207 208 208 209 - static int mtx1_wdt_probe(struct platform_device *pdev) 209 + static int __devinit mtx1_wdt_probe(struct platform_device *pdev) 210 210 { 211 211 int ret; 212 212 ··· 229 229 return 0; 230 230 } 231 231 232 - static int mtx1_wdt_remove(struct platform_device *pdev) 232 + static int __devexit mtx1_wdt_remove(struct platform_device *pdev) 233 233 { 234 234 /* FIXME: do we need to lock this test ? */ 235 235 if (mtx1_wdt_device.queue) { ··· 242 242 243 243 static struct platform_driver mtx1_wdt = { 244 244 .probe = mtx1_wdt_probe, 245 - .remove = mtx1_wdt_remove, 245 + .remove = __devexit_p(mtx1_wdt_remove), 246 246 .driver.name = "mtx1-wdt", 247 247 .driver.owner = THIS_MODULE, 248 248 };
+3 -3
drivers/watchdog/pnx4008_wdt.c
··· 246 246 .fops = &pnx4008_wdt_fops, 247 247 }; 248 248 249 - static int pnx4008_wdt_probe(struct platform_device *pdev) 249 + static int __devinit pnx4008_wdt_probe(struct platform_device *pdev) 250 250 { 251 251 int ret = 0, size; 252 252 struct resource *res; ··· 299 299 return ret; 300 300 } 301 301 302 - static int pnx4008_wdt_remove(struct platform_device *pdev) 302 + static int __devexit pnx4008_wdt_remove(struct platform_device *pdev) 303 303 { 304 304 misc_deregister(&pnx4008_wdt_miscdev); 305 305 if (wdt_clk) { ··· 321 321 .owner = THIS_MODULE, 322 322 }, 323 323 .probe = pnx4008_wdt_probe, 324 - .remove = pnx4008_wdt_remove, 324 + .remove = __devexit_p(pnx4008_wdt_remove), 325 325 }; 326 326 327 327 static int __init pnx4008_wdt_init(void)
+2 -2
drivers/watchdog/rdc321x_wdt.c
··· 245 245 return 0; 246 246 } 247 247 248 - static int rdc321x_wdt_remove(struct platform_device *pdev) 248 + static int __devexit rdc321x_wdt_remove(struct platform_device *pdev) 249 249 { 250 250 if (rdc321x_wdt_device.queue) { 251 251 rdc321x_wdt_device.queue = 0; ··· 259 259 260 260 static struct platform_driver rdc321x_wdt_driver = { 261 261 .probe = rdc321x_wdt_probe, 262 - .remove = rdc321x_wdt_remove, 262 + .remove = __devexit_p(rdc321x_wdt_remove), 263 263 .driver = { 264 264 .owner = THIS_MODULE, 265 265 .name = "rdc321x-wdt",
+3 -3
drivers/watchdog/rm9k_wdt.c
··· 345 345 return platform_get_resource_byname(pdv, type, buf); 346 346 } 347 347 348 - /* No hotplugging on the platform bus - use __init */ 349 - static int __init wdt_gpi_probe(struct platform_device *pdv) 348 + /* No hotplugging on the platform bus - use __devinit */ 349 + static int __devinit wdt_gpi_probe(struct platform_device *pdv) 350 350 { 351 351 int res; 352 352 const struct resource ··· 373 373 return res; 374 374 } 375 375 376 - static int __exit wdt_gpi_remove(struct platform_device *dev) 376 + static int __devexit wdt_gpi_remove(struct platform_device *dev) 377 377 { 378 378 int res; 379 379