greybus: loopback: hold a coarse lock while init/exit run
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Mon, 14 Sep 2015 09:48:40 +0000 (10:48 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 15 Sep 2015 04:35:58 +0000 (21:35 -0700)
commit29f020290d8897e3ed6ed8a8f8938c0b8545bbcd
tree64652ed8e10e9da15821d21c952440b3fb799f6e
parent6de00a5f32e09b58879175f2942ebeac699d3534
greybus: loopback: hold a coarse lock while init/exit run

This patch holds gb_dev.mutex for the duration of init and exit to reduce
complexity while ensuring that init and exit run atomically with respect
to slave threads @ gb_loopback_fn().

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c