From: Dmitry Torokhov on
To allow external tools detect presence of the driver in the kernel
when the driver is built in (as opposed to be compiled as a module)
export driver version as a read-only module parameter.

Signed-off-by: Dmitry Torokhov <dtor(a)vmware.com>
---
drivers/misc/vmware_balloon.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/vmware_balloon.c b/drivers/misc/vmware_balloon.c
index 2a1e804..f9b2221 100644
--- a/drivers/misc/vmware_balloon.c
+++ b/drivers/misc/vmware_balloon.c
@@ -43,9 +43,11 @@
#include <linux/seq_file.h>
#include <asm/hypervisor.h>

+#define VMW_BALLOON_VERSION "1.2.1.2-k"
+
MODULE_AUTHOR("VMware, Inc.");
MODULE_DESCRIPTION("VMware Memory Control (Balloon) Driver");
-MODULE_VERSION("1.2.1.1-k");
+MODULE_VERSION(VMW_BALLOON_VERSION);
MODULE_ALIAS("dmi:*:svnVMware*:*");
MODULE_ALIAS("vmware_vmmemctl");
MODULE_LICENSE("GPL");
@@ -842,3 +844,13 @@ static void __exit vmballoon_exit(void)
vmballoon_pop(&balloon);
}
module_exit(vmballoon_exit);
+
+/*
+ * Make the driver version exported as module parameter so that the
+ * driver is still visible if it is compiled into kernel
+ */
+static int param_get_vmballoon_version(char *buffer, struct kernel_param *kp)
+{
+ return sprintf(buffer, "%s", VMW_BALLOON_VERSION);
+}
+module_param_call(version, NULL, param_get_vmballoon_version, NULL, S_IRUGO);
--
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
 | 
Pages: 1
Prev: Linux 2.6.34.3
Next: Linux 2.6.35.1