Commit 6e5dd0bb authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

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: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 68190676
...@@ -62,8 +62,6 @@ struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd, ...@@ -62,8 +62,6 @@ struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd,
} }
EXPORT_SYMBOL_GPL(greybus_alloc_gbuf); EXPORT_SYMBOL_GPL(greybus_alloc_gbuf);
static DEFINE_MUTEX(gbuf_mutex);
static void free_gbuf(struct kref *kref) static void free_gbuf(struct kref *kref)
{ {
struct gbuf *gbuf = container_of(kref, struct gbuf, kref); struct gbuf *gbuf = container_of(kref, struct gbuf, kref);
...@@ -71,25 +69,15 @@ static void free_gbuf(struct kref *kref) ...@@ -71,25 +69,15 @@ static void free_gbuf(struct kref *kref)
gbuf->hd->driver->free_gbuf_data(gbuf); gbuf->hd->driver->free_gbuf_data(gbuf);
kmem_cache_free(gbuf_head_cache, gbuf); kmem_cache_free(gbuf_head_cache, gbuf);
mutex_unlock(&gbuf_mutex);
} }
void greybus_free_gbuf(struct gbuf *gbuf) void greybus_free_gbuf(struct gbuf *gbuf)
{ {
/* drop the reference count and get out of here */ /* 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); 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) int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t gfp_mask)
{ {
gbuf->status = -EINPROGRESS; gbuf->status = -EINPROGRESS;
......
...@@ -184,8 +184,6 @@ struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd, ...@@ -184,8 +184,6 @@ struct gbuf *greybus_alloc_gbuf(struct greybus_host_device *hd,
u16 dest_cport_id, unsigned int size, u16 dest_cport_id, unsigned int size,
gfp_t gfp_mask); gfp_t gfp_mask);
void greybus_free_gbuf(struct gbuf *gbuf); 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); int greybus_submit_gbuf(struct gbuf *gbuf, gfp_t mem_flags);
void greybus_kill_gbuf(struct gbuf *gbuf); void greybus_kill_gbuf(struct gbuf *gbuf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment