From ab69c4cea3b4ddf6bce4db810db37a3911b08e15 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Fri, 3 Jul 2015 17:00:29 +0530 Subject: [PATCH] greybus: svc: SVC is part of greybus core Its an essential part of greybus core and shouldn't be present as a separate module. Make it part of greybus.ko module. Signed-off-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/Makefile | 3 +-- drivers/staging/greybus/core.c | 9 +++++++++ drivers/staging/greybus/svc.c | 3 +-- drivers/staging/greybus/svc.h | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/staging/greybus/Makefile b/drivers/staging/greybus/Makefile index 163cd13e7545..1467c5b3fcd8 100644 --- a/drivers/staging/greybus/Makefile +++ b/drivers/staging/greybus/Makefile @@ -9,6 +9,7 @@ greybus-y := core.o \ connection.o \ protocol.o \ control.o \ + svc.o \ operation.o gb-phy-y := gpbridge.o \ @@ -26,7 +27,6 @@ gb-phy-y := gpbridge.o \ audio-gb-cmds.o # Prefix all modules with gb- -gb-svc-y := svc.o gb-vibrator-y := vibrator.o gb-battery-y := battery.o gb-loopback-y := loopback.o @@ -35,7 +35,6 @@ gb-es1-y := es1.o gb-es2-y := es2.o obj-m += greybus.o -obj-m += gb-svc.o obj-m += gb-phy.o obj-m += gb-vibrator.o obj-m += gb-battery.o diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 8d16e10b7e94..925e1dc00eff 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -280,8 +280,16 @@ static int __init gb_init(void) goto error_control; } + retval = gb_svc_protocol_init(); + if (retval) { + pr_err("gb_svc_protocol_init failed\n"); + goto error_svc; + } + return 0; /* Success */ +error_svc: + gb_control_protocol_exit(); error_control: gb_endo_exit(); error_endo: @@ -299,6 +307,7 @@ module_init(gb_init); static void __exit gb_exit(void) { + gb_svc_protocol_exit(); gb_control_protocol_exit(); gb_endo_exit(); gb_operation_exit(); diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c index 75b333783941..8a5a9b7c375d 100644 --- a/drivers/staging/greybus/svc.c +++ b/drivers/staging/greybus/svc.c @@ -239,5 +239,4 @@ static struct gb_protocol svc_protocol = { .connection_exit = gb_svc_connection_exit, .request_recv = gb_svc_request_recv, }; - -gb_protocol_driver(&svc_protocol); +gb_builtin_protocol_driver(svc_protocol); diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h index e26e63707e3d..b039aea4c409 100644 --- a/drivers/staging/greybus/svc.h +++ b/drivers/staging/greybus/svc.h @@ -19,4 +19,6 @@ int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id, int gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id, u8 intf2_id, u16 cport2_id); +int gb_svc_protocol_init(void); +void gb_svc_protocol_exit(void); #endif /* __SVC_H */ -- 2.20.1