diff options
Diffstat (limited to 'include/linux/dio.h')
-rw-r--r-- | include/linux/dio.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/include/linux/dio.h b/include/linux/dio.h index fae9395fcf4f..1e65ebc2a3db 100644 --- a/include/linux/dio.h +++ b/include/linux/dio.h | |||
@@ -276,37 +276,5 @@ static inline void dio_set_drvdata (struct dio_dev *d, void *data) | |||
276 | dev_set_drvdata(&d->dev, data); | 276 | dev_set_drvdata(&d->dev, data); |
277 | } | 277 | } |
278 | 278 | ||
279 | /* | ||
280 | * A helper function which helps ensure correct dio_driver | ||
281 | * setup and cleanup for commonly-encountered hotplug/modular cases | ||
282 | * | ||
283 | * This MUST stay in a header, as it checks for -DMODULE | ||
284 | */ | ||
285 | static inline int dio_module_init(struct dio_driver *drv) | ||
286 | { | ||
287 | int rc = dio_register_driver(drv); | ||
288 | |||
289 | if (rc > 0) | ||
290 | return 0; | ||
291 | |||
292 | /* iff CONFIG_HOTPLUG and built into kernel, we should | ||
293 | * leave the driver around for future hotplug events. | ||
294 | * For the module case, a hotplug daemon of some sort | ||
295 | * should load a module in response to an insert event. */ | ||
296 | #if defined(CONFIG_HOTPLUG) && !defined(MODULE) | ||
297 | if (rc == 0) | ||
298 | return 0; | ||
299 | #else | ||
300 | if (rc == 0) | ||
301 | rc = -ENODEV; | ||
302 | #endif | ||
303 | |||
304 | /* if we get here, we need to clean up DIO driver instance | ||
305 | * and return some sort of error */ | ||
306 | dio_unregister_driver(drv); | ||
307 | |||
308 | return rc; | ||
309 | } | ||
310 | |||
311 | #endif /* __KERNEL__ */ | 279 | #endif /* __KERNEL__ */ |
312 | #endif /* ndef _LINUX_DIO_H */ | 280 | #endif /* ndef _LINUX_DIO_H */ |