greybus: connection: make cport lookup thread-safe
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 19 Jan 2016 11:51:27 +0000 (12:51 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 19 Jan 2016 20:17:13 +0000 (12:17 -0800)
commitb53e0c9e8dceb170b054f186200b2fe3fb3718f2
tree03f844d337ebfe01fb5c559139ee21bc5c5e5a2c
parent210b508e45f00fd81c1ba35c979836d8ffea3980
greybus: connection: make cport lookup thread-safe

Use the gb_connection_mutex when making sure a remote CPort is
available.

This is needed when moving to driver-managed connections that can be
created and destroyed at any time.

Also check for duplicate bundle-less connections.

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/connection.c