greybus: count rather than list protocol users
authorAlex Elder <elder@linaro.org>
Wed, 5 Nov 2014 22:12:51 +0000 (16:12 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 5 Nov 2014 22:21:24 +0000 (14:21 -0800)
commit0e44765743c06664773475cd07684a70a29a6816
tree42c0b20cea922d313c7a4590c9fda3f0347f0fe4
parent6ae7fa4520c9a3e316996320ad6d6439f08bb63c
greybus: count rather than list protocol users

We don't really need a list of protocol users, we can just keep
track of how many there are.  Get rid of the list and use a count
instead.

Also, have gb_protocol_get() return the protocol rather than assigning
a passed-in connection pointer's protocol.  Make a comparable change
to the gb_protocol_put() interface.

Get rid of gb_protocol_find() (the version that locks), because it
is no longer needed.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/connection.c
drivers/staging/greybus/connection.h
drivers/staging/greybus/protocol.c
drivers/staging/greybus/protocol.h