iio: st_sensors: Init trigger before irq request
authorCrestez Dan Leonard <leonard.crestez@intel.com>
Fri, 13 May 2016 18:43:33 +0000 (21:43 +0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 29 May 2016 19:25:27 +0000 (20:25 +0100)
commitff05916f94f912b25e8efcf9b02c10d481977bab
tree4f418509a534fc6c19c7057cadbbdc57461a6520
parent65925b65ed98ffdb277cf5ea1af45731dac0b30b
iio: st_sensors: Init trigger before irq request

This fixes a possible race where an interrupt arrives before complete
initialization and crashes because iio_trigger_get_drvdata returns NULL.

Cc: Giuseppe Barba <giuseppe.barba@st.com>
Cc: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Crestez Dan Leonard <leonard.crestez@intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/common/st_sensors/st_sensors_trigger.c