iio:st_sensors: Fix oops when probing SPI devices
authorAlban Bedel <alban.bedel@avionic-design.de>
Mon, 20 Apr 2015 11:57:18 +0000 (13:57 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 26 Apr 2015 17:24:08 +0000 (18:24 +0100)
In SPI mode the transfer buffer is locked with a mutex. However this
mutex is only initilized after the probe, but some transfer needs to
be done in the probe.

To fix this bug we move the mutex initialization at the beginning of
the device probe.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>

No differences found