Commit 2c07817e authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: i2c-gb: move i2c protocol into the gpbridge driver

The i2c protocol belongs in the gpbridge driver, so move it
there.
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
Reviewed-by: default avatarAlex Elder <elder@linaro.org>
parent e1308c1f
...@@ -14,11 +14,11 @@ gpbridge-y := gpb.o \ ...@@ -14,11 +14,11 @@ gpbridge-y := gpb.o \
uart-gb.o \ uart-gb.o \
pwm-gb.o \ pwm-gb.o \
gpio-gb.o \ gpio-gb.o \
i2c-gb.o \
usb-gb.o usb-gb.o
obj-m += greybus.o obj-m += greybus.o
obj-m += gpbridge.o obj-m += gpbridge.o
obj-m += i2c-gb.o
obj-m += vibrator-gb.o obj-m += vibrator-gb.o
obj-m += battery-gb.o obj-m += battery-gb.o
obj-m += es1-ap-usb.o obj-m += es1-ap-usb.o
......
...@@ -41,8 +41,14 @@ static int __init gpbridge_init(void) ...@@ -41,8 +41,14 @@ static int __init gpbridge_init(void)
pr_err("error initializing usb protocol\n"); pr_err("error initializing usb protocol\n");
goto error_usb; goto error_usb;
} }
if (gb_i2c_protocol_init()) {
pr_err("error initializing usb protocol\n");
goto error_i2c;
}
return 0; return 0;
error_i2c:
gb_usb_protocol_exit();
error_usb: error_usb:
gb_sdio_protocol_exit(); gb_sdio_protocol_exit();
error_sdio: error_sdio:
...@@ -57,6 +63,7 @@ static int __init gpbridge_init(void) ...@@ -57,6 +63,7 @@ static int __init gpbridge_init(void)
static void __exit gpbridge_exit(void) static void __exit gpbridge_exit(void)
{ {
gb_i2c_protocol_exit();
gb_usb_protocol_exit(); gb_usb_protocol_exit();
gb_sdio_protocol_exit(); gb_sdio_protocol_exit();
gb_uart_protocol_exit(); gb_uart_protocol_exit();
......
...@@ -438,6 +438,12 @@ static struct gb_protocol i2c_protocol = { ...@@ -438,6 +438,12 @@ static struct gb_protocol i2c_protocol = {
.request_recv = NULL, /* no incoming requests */ .request_recv = NULL, /* no incoming requests */
}; };
gb_protocol_driver(&i2c_protocol); int gb_i2c_protocol_init(void)
{
return gb_protocol_register(&i2c_protocol);
}
MODULE_LICENSE("GPL v2"); void gb_i2c_protocol_exit(void)
{
gb_protocol_deregister(&i2c_protocol);
}
...@@ -66,6 +66,9 @@ extern void gb_sdio_protocol_exit(void); ...@@ -66,6 +66,9 @@ extern void gb_sdio_protocol_exit(void);
extern int gb_usb_protocol_init(void); extern int gb_usb_protocol_init(void);
extern void gb_usb_protocol_exit(void); extern void gb_usb_protocol_exit(void);
extern int gb_i2c_protocol_init(void);
extern void gb_i2c_protocol_exit(void);
#define gb_protocol_driver(__protocol) \ #define gb_protocol_driver(__protocol) \
static int __init protocol_init(void) \ static int __init protocol_init(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