OSDN Git Service

greybus: connection: un-abstract host cport id allocation
authorAlex Elder <elder@linaro.org>
Fri, 12 Jun 2015 15:21:08 +0000 (10:21 -0500)
committerGreg Kroah-Hartman <gregkh@google.com>
Fri, 12 Jun 2015 19:13:01 +0000 (12:13 -0700)
commitf9b0366f16c3926e92e7d108fe8666fac671d026
tree83e2078faa52a3490d30ce85035f390e9d211583
parentdeb58ca8299598f81123dd92456c0cc3a9a38555
greybus: connection: un-abstract host cport id allocation

I did this recently for the endo id allocation code.

It's clearer now that the allocation of a CPort ID to use for
the AP side of a connection is not very complicated, and it
happens in a pretty controlled environment.  The functions that
abstract getting and releasing those ids don't really add that
much value.

This patch removes gb_connection_hd_cport_id_alloc() and
gb_connection_hd_cport_id_free(), and just open-codes their
activity in the few places they are called.

It is obvious now that the CPort ID allocation isn't done in
atomic context, so we can change the ida_simple_get() call to
use GFP_KERNEL.

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