]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: gpbridge: Create module_gpbridge_driver()
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 9 May 2016 12:45:05 +0000 (18:15 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 14 May 2016 17:13:57 +0000 (19:13 +0200)
Create module_gpbridge_driver() for registering gpbridge module drivers.

Tested on EVT 1.5 by inserting GP test module, all the devices were
enumerated correctly.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/gpbridge.h

index 1af20d88af4b8a67dd23106894125f9beee16310..cd5ba9820cb057e0c417381bab0ce4c6e21d9a68 100644 (file)
@@ -87,5 +87,16 @@ extern void gb_i2c_driver_exit(void);
 extern int gb_spi_driver_init(void);
 extern void gb_spi_driver_exit(void);
 
+/**
+ * module_gpbridge_driver() - Helper macro for registering a gpbridge driver
+ * @__gpbridge_driver: gpbridge_driver structure
+ *
+ * Helper macro for gpbridge drivers to set up proper module init / exit
+ * functions.  Replaces module_init() and module_exit() and keeps people from
+ * printing pointless things to the kernel log when their driver is loaded.
+ */
+#define module_gpbridge_driver(__gpbridge_driver)      \
+       module_driver(__gpbridge_driver, gb_gpbridge_register, gb_gpbridge_deregister)
+
 #endif /* __GPBRIDGE_H */