summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/protocol.h
diff options
context:
space:
mode:
authorAlex Elder <elder@linaro.org>2014-11-05 16:12:51 -0600
committerGreg Kroah-Hartman <greg@kroah.com>2014-11-05 14:21:24 -0800
commit0e44765743c06664773475cd07684a70a29a6816 (patch)
tree42c0b20cea922d313c7a4590c9fda3f0347f0fe4 /drivers/staging/greybus/protocol.h
parent6ae7fa4520c9a3e316996320ad6d6439f08bb63c (diff)
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>
Diffstat (limited to 'drivers/staging/greybus/protocol.h')
-rw-r--r--drivers/staging/greybus/protocol.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/staging/greybus/protocol.h b/drivers/staging/greybus/protocol.h
index d53f67def779..aa7b5548e8a8 100644
--- a/drivers/staging/greybus/protocol.h
+++ b/drivers/staging/greybus/protocol.h
@@ -20,16 +20,15 @@ struct gb_protocol {
u8 id;
u8 major;
u8 minor;
+ u8 count;
- struct list_head connections; /* protocol users */
struct list_head links; /* global list */
};
bool gb_protocol_register(u8 id, u8 major, u8 minor);
bool gb_protocol_deregister(struct gb_protocol *protocol);
-bool gb_protocol_get(struct gb_connection *connection, u8 id,
- u8 major, u8 minor);
-void gb_protocol_put(struct gb_connection *connection);
+struct gb_protocol *gb_protocol_get(u8 id, u8 major, u8 minor);
+void gb_protocol_put(struct gb_protocol *protocol);
#endif /* __PROTOCOL_H */