greybus: kill greybus_{get,put}_gbuf()
authorAlex Elder <elder@linaro.org>
Tue, 18 Nov 2014 00:08:28 +0000 (18:08 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 18 Nov 2014 01:19:20 +0000 (17:19 -0800)
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 <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/gbuf.c
drivers/staging/greybus/greybus.h

index 6f8873af09e0bbf1747725fd6b860f7227b165ea..92da63257526ef834a3ae4a3e5b84089267faa4b 100644 (file)
@@ -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;
index 90469bb83b27113fd5b9974e8ea7bbb9bae5e84e..3af338223609c2033f71f06deaa1a623bd68432d 100644 (file)
@@ -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);