diff --git a/drivers/staging/greybus/core.c b/drivers/staging/greybus/core.c index 26e4b44bdf44..588e62412fd3 100644 --- a/drivers/staging/greybus/core.c +++ b/drivers/staging/greybus/core.c @@ -226,12 +226,6 @@ static int __init gb_init(void) goto error_ap; } - retval = gb_gbuf_init(); - if (retval) { - pr_err("gb_gbuf_init failed\n"); - goto error_gbuf; - } - retval = gb_operation_init(); if (retval) { pr_err("gb_operation_init failed\n"); @@ -250,8 +244,6 @@ static int __init gb_init(void) error_protocol: gb_operation_exit(); error_operation: - gb_gbuf_exit(); -error_gbuf: gb_ap_exit(); error_ap: bus_unregister(&greybus_bus_type); @@ -265,7 +257,6 @@ static void __exit gb_exit(void) { gb_protocol_exit(); gb_operation_exit(); - gb_gbuf_exit(); gb_ap_exit(); bus_unregister(&greybus_bus_type); gb_debugfs_cleanup(); diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 5ffd257de68f..d47cf367e412 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -13,41 +13,9 @@ #include #include #include -#include #include "greybus.h" -static struct kmem_cache *gbuf_head_cache; - -/** - * greybus_alloc_gbuf - allocate a greybus buffer - * - * @gmod: greybus device that wants to allocate this - * @cport: cport to send the data to - * @complete: callback when the gbuf is finished with - * @size: size of the buffer - * @gfp_mask: allocation mask - * - * TODO: someday it will be nice to handle DMA, but for now, due to the - * architecture we are stuck with, the greybus core has to allocate the buffer - * that the driver can then fill up with the data to be sent out. Curse - * hardware designers for this issue... - */ -struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd, - u16 dest_cport_id, - unsigned int size, - gfp_t gfp_mask) -{ - return kmem_cache_zalloc(gbuf_head_cache, gfp_mask); -} -EXPORT_SYMBOL_GPL(greybus_alloc_gbuf); - -void greybus_free_gbuf(struct gbuf *gbuf) -{ - kmem_cache_free(gbuf_head_cache, gbuf); -} -EXPORT_SYMBOL_GPL(greybus_free_gbuf); - int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask) { gbuf->status = -EINPROGRESS; @@ -77,16 +45,3 @@ void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, gb_connection_operation_recv(connection, data, length); } EXPORT_SYMBOL_GPL(greybus_cport_in); - -int gb_gbuf_init(void) -{ - gbuf_head_cache = kmem_cache_create("gbuf_head_cache", - sizeof(struct gbuf), 0, 0, NULL); - return 0; -} - -void gb_gbuf_exit(void) -{ - kmem_cache_destroy(gbuf_head_cache); - gbuf_head_cache = NULL; -} diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index e1f918d50df2..30d5625ea4ff 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -105,12 +105,6 @@ void greybus_remove_hd(struct greybus_host_device *hd); void greybus_cport_in(struct greybus_host_device *hd, u16 cport_id, u8 *data, size_t length); -struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd, - u16 dest_cport_id, - unsigned int size, - gfp_t gfp_mask); -void greybus_free_gbuf(struct gbuf *gbuf); - int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t mem_flags); void greybus_kill_gbuf(struct gbuf *gbuf);