Commit 58864652 authored by Eric Auger's avatar Eric Auger Committed by Alex Williamson

vfio: platform: introduce module_vfio_reset_handler macro

The module_vfio_reset_handler macro
- define a module alias
- implement module init/exit function which respectively registers
  and unregisters the reset function.
Signed-off-by: default avatarEric Auger <eric.auger@linaro.org>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent e086497d
...@@ -110,4 +110,18 @@ static struct vfio_platform_reset_node __reset ## _node = { \ ...@@ -110,4 +110,18 @@ static struct vfio_platform_reset_node __reset ## _node = { \
}; \ }; \
__vfio_platform_register_reset(&__reset ## _node) __vfio_platform_register_reset(&__reset ## _node)
#define module_vfio_reset_handler(compat, reset) \
MODULE_ALIAS("vfio-reset:" compat); \
static int __init reset ## _module_init(void) \
{ \
vfio_platform_register_reset(compat, reset); \
return 0; \
}; \
static void __exit reset ## _module_exit(void) \
{ \
vfio_platform_unregister_reset(compat, reset); \
}; \
module_init(reset ## _module_init); \
module_exit(reset ## _module_exit)
#endif /* VFIO_PLATFORM_PRIVATE_H */ #endif /* VFIO_PLATFORM_PRIVATE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment