From 7e9017d482a2678ed32e7f60e6bfea10bab2dfa1 Mon Sep 17 00:00:00 2001
From: Viresh Kumar <viresh.kumar@linaro.org>
Date: Wed, 1 Jul 2015 12:13:57 +0530
Subject: [PATCH] greybus: svc: Drop svc_set_route_send()

The responsibility of this routine is to configure ARA switch to
establish a connection between a cport on the AP and a cport on an
interface.

The SVC protocol is responsible for such requests and we already have
connection_{create|destroy}_operation() to take care of this.

Moreover, this request is not served by the firmware or gbsim today and
they just print a debug message on this request. And so it is safe to
drop svc_set_route_send() function and fix the required functionality of
configuring the switch in svc protocol driver later.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
---
 drivers/staging/greybus/ap.c      | 18 ------------------
 drivers/staging/greybus/bundle.c  |  6 ------
 drivers/staging/greybus/greybus.h |  3 ---
 3 files changed, 27 deletions(-)

diff --git a/drivers/staging/greybus/ap.c b/drivers/staging/greybus/ap.c
index 869f934732fc4..fc238170ad129 100644
--- a/drivers/staging/greybus/ap.c
+++ b/drivers/staging/greybus/ap.c
@@ -60,24 +60,6 @@ static int svc_msg_send(struct svc_msg *svc_msg, struct greybus_host_device *hd)
 	return retval;
 }
 
-
-int svc_set_route_send(struct gb_bundle *bundle,
-			       struct greybus_host_device *hd)
-{
-	struct svc_msg *svc_msg;
-
-	svc_msg = svc_msg_alloc(SVC_FUNCTION_UNIPRO_NETWORK_MANAGEMENT);
-	if (!svc_msg)
-		return -ENOMEM;
-
-	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 = bundle->device_id;
-
-	return svc_msg_send(svc_msg, hd);
-}
-
 static void svc_handshake(struct svc_function_handshake *handshake,
 			  int payload_length, struct greybus_host_device *hd)
 {
diff --git a/drivers/staging/greybus/bundle.c b/drivers/staging/greybus/bundle.c
index a5172e5f64b26..e636230144c70 100644
--- a/drivers/staging/greybus/bundle.c
+++ b/drivers/staging/greybus/bundle.c
@@ -236,12 +236,6 @@ int gb_bundle_init(struct gb_bundle *bundle, u8 device_id)
 
 	bundle->device_id = device_id;
 
-	ret = svc_set_route_send(bundle, intf->hd);
-	if (ret) {
-		dev_err(intf->hd->parent, "failed to set route (%d)\n", ret);
-		return ret;
-	}
-
 	ret = gb_bundle_connections_init(bundle);
 	if (ret) {
 		dev_err(intf->hd->parent, "interface bundle init error %d\n",
diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h
index 6874939e6d1e8..c1157df9230b7 100644
--- a/drivers/staging/greybus/greybus.h
+++ b/drivers/staging/greybus/greybus.h
@@ -163,9 +163,6 @@ struct dentry *gb_debugfs_get(void);
 
 extern struct bus_type greybus_bus_type;
 
-int svc_set_route_send(struct gb_bundle *bundle,
-			       struct greybus_host_device *hd);
-
 extern struct device_type greybus_endo_type;
 extern struct device_type greybus_module_type;
 extern struct device_type greybus_interface_type;
-- 
2.30.2