[PATCH 6/6] drivers, staging, unisys Add visorhid module autoloading code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prarit Bhargava <prarit@xxxxxxxxxx>

This patch adds an module alias and a MODULE_DEVICE_TABLE to autoload
the
visorhid driver when an appropriate device is created by the visorbus.
Additional code cleanups to match the other visor* drivers.

Signed-off-by: Prarit Bhargava <prarit@xxxxxxxxxx>
---
 drivers/staging/unisys/visorhid/keyboardchannel.h |  3 ++-
 drivers/staging/unisys/visorhid/mousechannel.h    |  4 +++-
 drivers/staging/unisys/visorhid/visorhid.c        | 18 ++++++------------
 3 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/unisys/visorhid/keyboardchannel.h b/drivers/staging/unisys/visorhid/keyboardchannel.h
index 1d11966..2ed2602 100644
--- a/drivers/staging/unisys/visorhid/keyboardchannel.h
+++ b/drivers/staging/unisys/visorhid/keyboardchannel.h
@@ -21,10 +21,11 @@
 #include "channel.h"
 #include "ultrainputreport.h"
 
-/* {C73416D0-B0B8-44af-B304-9D2AE99F1B3D} */
+/* {c73416d0-b0b8-44af-b304-9d2ae99f1b3d} */
 #define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID				\
 	UUID_LE(0xc73416d0, 0xb0b8, 0x44af,				\
 		0xb3, 0x4, 0x9d, 0x2a, 0xe9, 0x9f, 0x1b, 0x3d)
+#define SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR "c73416d0-b0b8-44af-b304-9d2ae99f1b3d"
 #define SPAR_KEYBOARD_CHANNEL_PROTOCOL_VERSIONID 1
 #define KEYBOARD_MAXINPUTREPORTS 50
 
diff --git a/drivers/staging/unisys/visorhid/mousechannel.h b/drivers/staging/unisys/visorhid/mousechannel.h
index 2633078..256477a 100644
--- a/drivers/staging/unisys/visorhid/mousechannel.h
+++ b/drivers/staging/unisys/visorhid/mousechannel.h
@@ -21,10 +21,12 @@
 #include "channel.h"
 #include "ultrainputreport.h"
 
-/* {ADDF07D4-94A9-46e2-81C3-61ABCDBDBD87} */
+/* {addf07d4-94a9-46e2-81c3-61abcdbdbd87} */
 #define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID  \
 	UUID_LE(0xaddf07d4, 0x94a9, 0x46e2, \
 		0x81, 0xc3, 0x61, 0xab, 0xcd, 0xbd, 0xbd, 0x87)
+#define SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR \
+	"addf07d4-94a9-46e2-81c3-61abcdbdbd87"
 #define SPAR_MOUSE_CHANNEL_PROTOCOL_VERSIONID 1
 #define MOUSE_MAXINPUTREPORTS 50
 
diff --git a/drivers/staging/unisys/visorhid/visorhid.c b/drivers/staging/unisys/visorhid/visorhid.c
index 1eaade0..7785088 100644
--- a/drivers/staging/unisys/visorhid/visorhid.c
+++ b/drivers/staging/unisys/visorhid/visorhid.c
@@ -53,19 +53,13 @@ static void unregister_client_input(struct input_dev *visorinput_dev);
 
 /* GUIDS for all channel types supported by this driver. */
 static struct visor_channeltype_descriptor visorhid_channel_types[] = {
-	{
-		.guid = SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID,
-		.name = "keyboard"
-	},
-	{
-		.guid = SPAR_MOUSE_CHANNEL_PROTOCOL_UUID,
-		.name = "mouse"
-	},
-	{
-		.guid = NULL_UUID_LE,
-		.name = NULL
-	}
+	{ SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID, "keyboard"},
+	{ SPAR_MOUSE_CHANNEL_PROTOCOL_UUID, "mouse"},
+	{ NULL_UUID_LE, NULL }
 };
+MODULE_DEVICE_TABLE(visorbus, visorhid_channel_types);
+MODULE_ALIAS("visorbus:" SPAR_MOUSE_CHANNEL_PROTOCOL_UUID_STR);
+MODULE_ALIAS("visorbus:" SPAR_KEYBOARD_CHANNEL_PROTOCOL_UUID_STR);
 
 /** This is used to tell the visor bus driver which types of visor devices
  *  we support, and what functions to call when a visor device that we support
-- 
2.1.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux