(!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;
}
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 = {
.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 */
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
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 {
#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 {
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;
}
*/
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)