diff --git a/Makefile.dkms b/Makefile.dkms index 48ec687..3a06762 100644 --- a/Makefile.dkms +++ b/Makefile.dkms @@ -1,6 +1,6 @@ modname := bbswitch DKMS := dkms -modver := $(shell awk -F'"' '/MODULE_VERSION/{print $$2}' < bbswitch.c) +modver := $(shell awk -F'"' '/define *BBSWITCH_VERSION/{print $$2}' < bbswitch.c) # directory in which generated files are stored DKMS_DEST := /usr/src/$(modname)-$(modver) diff --git a/bbswitch.c b/bbswitch.c index 6dc6601..5d2858a 100644 --- a/bbswitch.c +++ b/bbswitch.c @@ -16,10 +16,12 @@ #include #include +#define BBSWITCH_VERSION "0.4.1" + MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Toggle the discrete graphics card"); MODULE_AUTHOR("Peter Lekensteyn "); -MODULE_VERSION("0.4.1"); +MODULE_VERSION(BBSWITCH_VERSION); enum { CARD_UNCHANGED = -1, @@ -406,6 +408,8 @@ static int __init bbswitch_init(void) { struct pci_dev *pdev = NULL; acpi_handle igd_handle = NULL; + printk(KERN_INFO "bbswitch: version %s\n", BBSWITCH_VERSION); + while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL }; acpi_handle handle;