From 7dd26263248c6c567c05772959d4d6a21240daa8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 24 Dec 2014 13:01:42 -0800 Subject: [PATCH] greybus: battery-gb: move the battery protocol out to a stand-alone module This moves the battery class protocol to be a stand-alone kernel module. Signed-off-by: Greg Kroah-Hartman Reviewed-by: Alex Elder --- drivers/staging/greybus/Makefile | 2 +- drivers/staging/greybus/battery-gb.c | 10 ++-------- drivers/staging/greybus/protocol.c | 5 ----- drivers/staging/greybus/protocol.h | 3 --- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile index f7284680f6e0..79cb193e453b 100644 --- a/drivers/staging/greybus/Makefile +++ b/drivers/staging/greybus/Makefile @@ -12,12 +12,12 @@ greybus-y := core.o \ pwm-gb.o \ sdio-gb.o \ uart-gb.o \ - battery-gb.o \ usb-gb.o obj-m += greybus.o obj-m += i2c-gb.o obj-m += vibrator-gb.o +obj-m += battery-gb.o obj-m += es1-ap-usb.o KERNELVER ?= $(shell uname -r) diff --git a/drivers/staging/greybus/battery-gb.c b/drivers/staging/greybus/battery-gb.c index f6b0dd681430..7ce37377bca5 100644 --- a/drivers/staging/greybus/battery-gb.c +++ b/drivers/staging/greybus/battery-gb.c @@ -367,12 +367,6 @@ static struct gb_protocol battery_protocol = { .request_recv = NULL, /* no incoming requests */ }; -int gb_battery_protocol_init(void) -{ - return gb_protocol_register(&battery_protocol); -} +gb_protocol_driver(&battery_protocol); -void gb_battery_protocol_exit(void) -{ - gb_protocol_deregister(&battery_protocol); -} +MODULE_LICENSE("GPL v2"); diff --git a/drivers/staging/greybus/protocol.c b/drivers/staging/greybus/protocol.c index 0d3c3367dab7..e32f4ac8c7f2 100644 --- a/drivers/staging/greybus/protocol.c +++ b/drivers/staging/greybus/protocol.c @@ -183,10 +183,6 @@ bool gb_protocol_init(void) { bool ret = true; - if (gb_battery_protocol_init()) { - pr_err("error initializing battery protocol\n"); - ret = false; - } if (gb_gpio_protocol_init()) { pr_err("error initializing gpio protocol\n"); ret = false; @@ -216,5 +212,4 @@ void gb_protocol_exit(void) gb_sdio_protocol_exit(); gb_uart_protocol_exit(); gb_gpio_protocol_exit(); - gb_battery_protocol_exit(); } diff --git a/drivers/staging/greybus/protocol.h b/drivers/staging/greybus/protocol.h index 7b1c09c941b1..1acc61594461 100644 --- a/drivers/staging/greybus/protocol.h +++ b/drivers/staging/greybus/protocol.h @@ -51,9 +51,6 @@ void gb_protocol_put(struct gb_protocol *protocol); * Declared here for now. They could be added via modules, or maybe * just use initcalls (which level?). */ -extern int gb_battery_protocol_init(void); -extern void gb_battery_protocol_exit(void); - extern int gb_gpio_protocol_init(void); extern void gb_gpio_protocol_exit(void); -- 2.39.5