From: Dmitry Torokhov <dtor@vmware.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Len Brown <lenb@kernel.org>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: [PATCH 2/2] VMware balloon: export module version as module parameter
Date: Tue, 10 Aug 2010 11:58:45 -0700 [thread overview]
Message-ID: <1281466725-22549-2-git-send-email-dtor@vmware.com> (raw)
In-Reply-To: <1281466725-22549-1-git-send-email-dtor@vmware.com>
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@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
next prev parent reply other threads:[~2010-08-10 18:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 18:58 [PATCH 1/2] param: allow omitting set() methods for truly read-only params Dmitry Torokhov
2010-08-10 18:58 ` Dmitry Torokhov [this message]
2010-08-11 1:39 ` Rusty Russell
2010-08-11 7:35 ` Dmitry Torokhov
2010-08-11 10:49 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281466725-22549-2-git-send-email-dtor@vmware.com \
--to=dtor@vmware.com \
--cc=akpm@linux-foundation.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox