Commit ac4cbc57 authored by Vaibhav Hiremath's avatar Vaibhav Hiremath Committed by Greg Kroah-Hartman

greybus: gpbridge: Add gpbridge driver init/exit helper macros

In order to help bridged-phy drivers to define init()/exit()
functions, define helper macro in gpbridge.h file.

Testing Done: Tested on gbsim.
Signed-off-by: default avatarVaibhav Hiremath <vaibhav.hiremath@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Tested-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 1d5f9ef9
...@@ -56,6 +56,16 @@ void gb_gpbridge_deregister_driver(struct gpbridge_driver *driver); ...@@ -56,6 +56,16 @@ void gb_gpbridge_deregister_driver(struct gpbridge_driver *driver);
#define gb_gpbridge_deregister(driver) \ #define gb_gpbridge_deregister(driver) \
gb_gpbridge_deregister_driver(driver) gb_gpbridge_deregister_driver(driver)
#define gb_gpbridge_builtin_driver(__driver) \
int __init gb_##__driver##_init(void) \
{ \
return gb_gpbridge_register(&__driver); \
} \
void gb_##__driver##_exit(void) \
{ \
gb_gpbridge_deregister(&__driver); \
}
extern int gb_gpio_protocol_init(void); extern int gb_gpio_protocol_init(void);
extern void gb_gpio_protocol_exit(void); extern void gb_gpio_protocol_exit(void);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment