1
0
Fork 0

greybus: i2c-gb: split out into a stand-alone kernel module.

This splits the i2c-gb protocol into a stand-alone kernel module.

It's not going to stay in this fashion for long, this was done to test
the "can a protcol be loaded later" logic.  Future refactoring is going
to move the gpbridge protocols to a separate kernel module, where this
protocol is going to live.

But for now, split it out, it is good to test with, and shows a bug in
gbsim at the moment.

Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
hifive-unleashed-5.1
Greg Kroah-Hartman 2014-12-23 15:16:54 -08:00
parent fb69cb506c
commit 900ceba9e4
4 changed files with 15 additions and 17 deletions

View File

@ -8,7 +8,6 @@ greybus-y := core.o \
connection.o \
protocol.o \
operation.o \
i2c-gb.o \
gpio-gb.o \
pwm-gb.o \
sdio-gb.o \
@ -18,6 +17,7 @@ greybus-y := core.o \
usb-gb.o
obj-m += greybus.o
obj-m += i2c-gb.o
obj-m += es1-ap-usb.o
KERNELVER ?= $(shell uname -r)

View File

@ -438,12 +438,6 @@ static struct gb_protocol i2c_protocol = {
.request_recv = NULL, /* no incoming requests */
};
int gb_i2c_protocol_init(void)
{
return gb_protocol_register(&i2c_protocol);
}
gb_protocol_driver(&i2c_protocol);
void gb_i2c_protocol_exit(void)
{
gb_protocol_deregister(&i2c_protocol);
}
MODULE_LICENSE("GPL v2");

View File

@ -184,10 +184,6 @@ bool gb_protocol_init(void)
pr_err("error initializing gpio protocol\n");
ret = false;
}
if (gb_i2c_protocol_init()) {
pr_err("error initializing i2c protocol\n");
ret = false;
}
if (gb_pwm_protocol_init()) {
pr_err("error initializing pwm protocol\n");
ret = false;
@ -217,7 +213,6 @@ void gb_protocol_exit(void)
gb_vibrator_protocol_exit();
gb_sdio_protocol_exit();
gb_uart_protocol_exit();
gb_i2c_protocol_exit();
gb_gpio_protocol_exit();
gb_battery_protocol_exit();
}

View File

@ -53,9 +53,6 @@ extern void gb_battery_protocol_exit(void);
extern int gb_gpio_protocol_init(void);
extern void gb_gpio_protocol_exit(void);
extern int gb_i2c_protocol_init(void);
extern void gb_i2c_protocol_exit(void);
extern int gb_pwm_protocol_init(void);
extern void gb_pwm_protocol_exit(void);
@ -74,4 +71,16 @@ extern void gb_usb_protocol_exit(void);
bool gb_protocol_init(void);
void gb_protocol_exit(void);
#define gb_protocol_driver(__protocol) \
static int __init protocol_init(void) \
{ \
return gb_protocol_register(__protocol); \
} \
module_init(protocol_init); \
static void __exit protocol_exit(void) \
{ \
gb_protocol_deregister(__protocol); \
} \
module_exit(protocol_exit);
#endif /* __PROTOCOL_H */