greybus: fix an allocation flag bug
authorAlex Elder <elder@linaro.org>
Tue, 18 Nov 2014 19:26:38 +0000 (13:26 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 18 Nov 2014 20:46:15 +0000 (12:46 -0800)
commit4f83b8d34964ef343afe5e8f731a0e37e311a42d
treee1a977ae96a81e7a4fe6974baf268b3f77724fd8
parent374e6a269cc3b1f044be78215c3e96021796de7d
greybus: fix an allocation flag bug

We allocate message buffers with GFP_KERNEL allocation flags if
possible.  However when an incoming request message is received we
can be in interrupt context, so we must use GFP_ATOMIC in that case.

The computation of gfp_flags in gb_operation_message_init() is
wrong.  It is needlessly using GFP_ATOMIC when allocating outbound
response buffers.  Fix the flawed logic.

Change the name of "data_out" to be "outbound" to be consistent with
usage elsewhere.  (Data/messages are "inbound" or "outbound";
requests are "incoming" or "outgoing".)

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