greybus: core: make greybus_kill_gbuf not return a value
We can't do anything if killing a gbuf fails, so just make this function
"always" be successful.
At the same time, make the host controller function also be called
"kill_gbuf" to keep the terminology in sync.
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Reviewed-by: Alex Elder <elder@linaro.org>
diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c
index 1436b3d..61fd690 100644
--- a/drivers/staging/greybus/core.c
+++ b/drivers/staging/greybus/core.c
@@ -216,7 +216,7 @@
(!driver->free_gbuf_data) ||
(!driver->submit_svc) ||
(!driver->submit_gbuf) ||
- (!driver->abort_gbuf)) {
+ (!driver->kill_gbuf)) {
pr_err("Must implement all greybus_host_driver callbacks!\n");
return NULL;
}
diff --git a/drivers/staging/greybus/es1-ap-usb.c b/drivers/staging/greybus/es1-ap-usb.c
index a207294..b8784b1 100644
--- a/drivers/staging/greybus/es1-ap-usb.c
+++ b/drivers/staging/greybus/es1-ap-usb.c
@@ -234,15 +234,14 @@
return retval;
}
-static int abort_gbuf(struct gbuf *gbuf)
+static void kill_gbuf(struct gbuf *gbuf)
{
struct urb *urb = gbuf->hcd_data;
if (!urb)
- return -EINVAL;
+ return;
usb_kill_urb(urb);
- return 0;
}
static struct greybus_host_driver es1_driver = {
@@ -251,7 +250,7 @@
.free_gbuf_data = free_gbuf_data,
.submit_svc = submit_svc,
.submit_gbuf = submit_gbuf,
- .abort_gbuf = abort_gbuf,
+ .kill_gbuf = kill_gbuf,
};
/* Common function to report consistent warnings based on URB status */
diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c
index 726a1f4..4f591aa 100644
--- a/drivers/staging/greybus/gbuf.c
+++ b/drivers/staging/greybus/gbuf.c
@@ -104,14 +104,14 @@
return hd->driver->submit_gbuf(gbuf, gfp_mask);
}
-int greybus_kill_gbuf(struct gbuf *gbuf)
+void greybus_kill_gbuf(struct gbuf *gbuf)
{
struct greybus_host_device *hd = gbuf->connection->hd;
if (gbuf->status != -EINPROGRESS)
- return -EINVAL;
+ return;
- return hd->driver->abort_gbuf(gbuf);
+ hd->driver->kill_gbuf(gbuf);
}
#define MAX_CPORTS 1024
diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h
index 8b6ea05..1e3f31d 100644
--- a/drivers/staging/greybus/greybus.h
+++ b/drivers/staging/greybus/greybus.h
@@ -170,7 +170,7 @@
int (*submit_svc)(struct svc_msg *svc_msg,
struct greybus_host_device *hd);
int (*submit_gbuf)(struct gbuf *gbuf, gfp_t gfp_mask);
- int (*abort_gbuf)(struct gbuf *gbuf);
+ void (*kill_gbuf)(struct gbuf *gbuf);
};
struct greybus_host_device {
@@ -203,7 +203,7 @@
#define greybus_put_gbuf greybus_free_gbuf
int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t mem_flags);
-int greybus_kill_gbuf(struct gbuf *gbuf);
+void greybus_kill_gbuf(struct gbuf *gbuf);
struct greybus_driver {
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index c94e509..9b889b1 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -175,7 +175,7 @@
ret = wait_for_completion_interruptible(&operation->completion);
/* If interrupted, cancel the in-flight buffer */
if (ret < 0)
- ret = greybus_kill_gbuf(operation->request);
+ greybus_kill_gbuf(operation->request);
return ret;
}
@@ -519,17 +519,10 @@
*/
void gb_operation_cancel(struct gb_operation *operation)
{
- int ret;
-
operation->canceled = true;
- ret = greybus_kill_gbuf(operation->request);
- if (ret)
- pr_warn("error %d killing request gbuf\n", ret);
- if (operation->response) {
- ret = greybus_kill_gbuf(operation->response);
- if (ret)
- pr_warn("error %d killing response gbuf\n", ret);
- }
+ greybus_kill_gbuf(operation->request);
+ if (operation->response)
+ greybus_kill_gbuf(operation->response);
}
int gb_operation_init(void)