greybus: connection: check for duplicate cport ids
authorAlex Elder <elder@linaro.org>
Tue, 9 Jun 2015 22:42:58 +0000 (17:42 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 10 Jun 2015 17:38:23 +0000 (10:38 -0700)
commitf5c2be9e9bd934973d3e51b933bf7c03f85d2010
tree35c0091405999b6a696aab54ef463bc003c2f997
parent8267616b3ef73b22c9ed5b87905c13fc332fe507
greybus: connection: check for duplicate cport ids

Check at connection creation time for an attempt to create a
connection with an interface CPort ID that's the same as one that's
already been created.

Define a new helper function to look for such a duplicate.  The
check for a duplicate is only performed at initialization time,
and CPorts are initialized serially for each bundle, so there's
no need to acquire the list lock for this search.

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