Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -110,4 +110,18 @@ static struct vfio_platform_reset_node __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 */