aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGravatar Viresh Kumar <viresh.kumar@linaro.org> 2015-08-31 17:21:05 +0530
committerGravatar Johan Hovold <johan@hovoldconsulting.com> 2015-09-03 14:33:37 +0200
commitd9fcffff2c5442225cec21f55e74fb752e67e57f (patch)
treea329e9ba7766b3019705f932fbdffa313b097f4f /drivers
parentgreybus: greybus_protocols: Pack all request/response structure (diff)
downloadlinux-d9fcffff2c5442225cec21f55e74fb752e67e57f.tar.gz
linux-d9fcffff2c5442225cec21f55e74fb752e67e57f.tar.bz2
linux-d9fcffff2c5442225cec21f55e74fb752e67e57f.zip
greybus: svc: No need to return errors from [gb_]svc_connection_destroy()
These routines are responsible to destroy a connection that is going away, the return value is of no use. At best, print an error message to show that we got an error. Make their return type void. Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/greybus/svc.c22
-rw-r--r--drivers/staging/greybus/svc.h4
2 files changed, 16 insertions, 10 deletions
diff --git a/drivers/staging/greybus/svc.c b/drivers/staging/greybus/svc.c
index 42b89ee9e094..e56cb187786f 100644
--- a/drivers/staging/greybus/svc.c
+++ b/drivers/staging/greybus/svc.c
@@ -125,19 +125,26 @@ static int connection_create_operation(struct gb_svc *svc,
&request, sizeof(request), NULL, 0);
}
-static int connection_destroy_operation(struct gb_svc *svc,
+static void connection_destroy_operation(struct gb_svc *svc,
u8 intf1_id, u16 cport1_id,
u8 intf2_id, u16 cport2_id)
{
struct gb_svc_conn_destroy_request request;
+ struct gb_connection *connection = svc->connection;
+ int ret;
request.intf1_id = intf1_id;
request.cport1_id = cport1_id;
request.intf2_id = intf2_id;
request.cport2_id = cport2_id;
- return gb_operation_sync(svc->connection, GB_SVC_TYPE_CONN_DESTROY,
- &request, sizeof(request), NULL, 0);
+ ret = gb_operation_sync(connection, GB_SVC_TYPE_CONN_DESTROY,
+ &request, sizeof(request), NULL, 0);
+ if (ret) {
+ dev_err(&connection->dev,
+ "failed to destroy connection (%hhx:%hx %hhx:%hx) %d\n",
+ intf1_id, cport1_id, intf2_id, cport2_id, ret);
+ }
}
static int route_create_operation(struct gb_svc *svc, u8 intf1_id, u8 dev1_id,
@@ -175,12 +182,11 @@ int gb_svc_connection_create(struct gb_svc *svc,
}
EXPORT_SYMBOL_GPL(gb_svc_connection_create);
-int gb_svc_connection_destroy(struct gb_svc *svc,
- u8 intf1_id, u16 cport1_id,
- u8 intf2_id, u16 cport2_id)
+void gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
+ u8 intf2_id, u16 cport2_id)
{
- return connection_destroy_operation(svc, intf1_id, cport1_id,
- intf2_id, cport2_id);
+ connection_destroy_operation(svc, intf1_id, cport1_id, intf2_id,
+ cport2_id);
}
EXPORT_SYMBOL_GPL(gb_svc_connection_destroy);
diff --git a/drivers/staging/greybus/svc.h b/drivers/staging/greybus/svc.h
index ee39479cf9b2..dae4a08bd463 100644
--- a/drivers/staging/greybus/svc.h
+++ b/drivers/staging/greybus/svc.h
@@ -16,8 +16,8 @@ int gb_svc_intf_device_id(struct gb_svc *svc, u8 intf_id, u8 device_id);
int gb_svc_intf_reset(struct gb_svc *svc, u8 intf_id);
int gb_svc_connection_create(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
u8 intf2_id, u16 cport2_id);
-int gb_svc_connection_destroy(struct gb_svc *svc, u8 intf1_id, u16 cport1_id,
- u8 intf2_id, u16 cport2_id);
+void 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);