From 6e5dd0bbbb046df2b6a5ba72d74b611c1f15f467 Mon Sep 17 00:00:00 2001 From: Alex Elder Date: Mon, 17 Nov 2014 18:08:28 -0600 Subject: [PATCH] greybus: kill greybus_{get,put}_gbuf() These functions are never used, so we can get rid of them. Since there's no reference-getting function any more, we no longer need "gbuf_mutex" to avoid racing gets and puts, so get rid of that too. Signed-off-by: Alex Elder Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/gbuf.c | 14 +------------- drivers/staging/greybus/greybus.h | 2 -- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/staging/greybus/gbuf.c b/drivers/staging/greybus/gbuf.c index 6f8873af09e0..92da63257526 100644 --- a/drivers/staging/greybus/gbuf.c +++ b/drivers/staging/greybus/gbuf.c @@ -62,8 +62,6 @@ struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd, } EXPORT_SYMBOL_GPL(greybus_alloc_gbuf); -static DEFINE_MUTEX(gbuf_mutex); - static void free_gbuf(struct kref *kref) { struct gbuf *gbuf = container_of(kref, struct gbuf, kref); @@ -71,25 +69,15 @@ static void free_gbuf(struct kref *kref) gbuf->hd->driver->free_gbuf_data(gbuf); kmem_cache_free(gbuf_head_cache, gbuf); - mutex_unlock(&gbuf_mutex); } void greybus_free_gbuf(struct gbuf *gbuf) { /* drop the reference count and get out of here */ - kref_put_mutex(&gbuf->kref, free_gbuf, &gbuf_mutex); + kref_put(&gbuf->kref, free_gbuf); } EXPORT_SYMBOL_GPL(greybus_free_gbuf); -struct gbuf *greybus_get_gbuf(struct gbuf *gbuf) -{ - mutex_lock(&gbuf_mutex); - kref_get(&gbuf->kref); - mutex_unlock(&gbuf_mutex); - return gbuf; -} -EXPORT_SYMBOL_GPL(greybus_get_gbuf); - int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask) { gbuf->status = -EINPROGRESS; diff --git a/drivers/staging/greybus/greybus.h b/drivers/staging/greybus/greybus.h index 90469bb83b27..3af338223609 100644 --- a/drivers/staging/greybus/greybus.h +++ b/drivers/staging/greybus/greybus.h @@ -184,8 +184,6 @@ 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); -struct gbuf *greybus_get_gbuf(struct gbuf *gbuf); -#define greybus_put_gbuf greybus_free_gbuf int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t mem_flags); void greybus_kill_gbuf(struct gbuf *gbuf); -- 2.20.1