From: Alex Elder Date: Wed, 22 Oct 2014 07:04:31 +0000 (-0500) Subject: greybus: make svc_set_route_send() public X-Git-Tag: v4.9-rc1~119^2~378^2~21^2~1969 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=525f1467bc22ad7d0866444b3a57c21ba64a0dd2;p=karo-tx-linux.git greybus: make svc_set_route_send() public Give svc_set_route_send() non-private scope so it can be used by a function outside "ap.c" in the next patch. Change its type so it can tell its caller if an error occurs. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c index 46553b1cf312..7ea329cfa1eb 100644 --- a/drivers/staging/greybus/ap.c +++ b/drivers/staging/greybus/ap.c @@ -100,24 +100,26 @@ static void svc_handshake(struct svc_function_handshake *handshake, svc_msg->handshake.version_major = GREYBUS_VERSION_MAJOR; svc_msg->handshake.version_minor = GREYBUS_VERSION_MINOR; svc_msg->handshake.handshake_type = SVC_HANDSHAKE_AP_HELLO; - svc_msg_send(svc_msg, hd); + + (void)svc_msg_send(svc_msg, hd); } -static void svc_set_route_send(struct gb_interface *interface, +int svc_set_route_send(struct gb_interface *interface, struct greybus_host_device *hd) { struct svc_msg *svc_msg; svc_msg = svc_msg_alloc(SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT); if (!svc_msg) - return; + return -ENOMEM; svc_msg->header.function_id = SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT; svc_msg->header.message_type = SVC_MSG_DATA; svc_msg->header.payload_length = cpu_to_le16(sizeof(struct svc_function_unipro_set_route)); svc_msg->management.set_route.device_id = interface->device_id; - svc_msg_send(svc_msg, hd); + + return svc_msg_send(svc_msg, hd); } static void svc_management(struct svc_function_unipro_management *management, @@ -149,7 +151,7 @@ static void svc_management(struct svc_function_unipro_management *management, return; } interface->device_id = management->link_up.device_id; - svc_set_route_send(interface, hd); + (void)svc_set_route_send(interface, hd); break; case SVC_MANAGEMENT_AP_DEVICE_ID: hd->device_id = management->ap_device_id.device_id; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 4baa37289334..617d55ca7e1d 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -275,7 +275,8 @@ void gb_gpio_controller_exit(struct gb_connection *connection); int gb_tty_init(void); void gb_tty_exit(void); - +int svc_set_route_send(struct gb_interface *interface, + struct greybus_host_device *hd); #endif /* __KERNEL__ */ #endif /* __LINUX_GREYBUS_H */