[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1445603835-14506-4-git-send-email-eric.auger@linaro.org>
Date: Fri, 23 Oct 2015 14:37:11 +0200
From: Eric Auger <eric.auger@...aro.org>
To: eric.auger@...com, eric.auger@...aro.org,
alex.williamson@...hat.com, b.reynal@...tualopensystems.com,
arnd@...db.de, linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.cs.columbia.edu, kvm@...r.kernel.org
Cc: christoffer.dall@...aro.org, linux-kernel@...r.kernel.org,
patches@...aro.org
Subject: [PATCH v3 3/7] 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: Eric Auger <eric.auger@...aro.org>
---
v2 -> v3:
- use vfio_platform_register_reset macro
v1 -> v2:
- remove vfio_platform_reset_private.h and move back the macro to
vfio_platform_private.h header: removed reset_module_register &
unregister (symbol_get)
- defines the module_vfio_reset_handler macro as suggested by Arnd
(formerly in vfio_platform_reset_private.h)
---
drivers/vfio/platform/vfio_platform_private.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h
index 277521a..5a1e8e6 100644
--- a/drivers/vfio/platform/vfio_platform_private.h
+++ b/drivers/vfio/platform/vfio_platform_private.h
@@ -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); \
+}; \
+module_init(reset ## _module_init); \
+module_exit(reset ## _module_exit)
+
#endif /* VFIO_PLATFORM_PRIVATE_H */
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists