OSDN Git Service

greybus: svc: SVC is part of greybus core
authorViresh Kumar <viresh.kumar@linaro.org>
Fri, 3 Jul 2015 11:30:29 +0000 (17:00 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 8 Jul 2015 18:44:25 +0000 (11:44 -0700)
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 <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/core.c
drivers/staging/greybus/svc.c
drivers/staging/greybus/svc.h

index 163cd13..1467c5b 100644 (file)
@@ -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
index 8d16e10..925e1dc 100644 (file)
@@ -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();
index 75b3337..8a5a9b7 100644 (file)
@@ -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);
index e26e637..b039aea 100644 (file)
@@ -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 */