stm class: Fix stm device initialization order
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 4 Mar 2016 14:48:14 +0000 (16:48 +0200)
committerAlexander Shishkin <alexander.shishkin@linux.intel.com>
Fri, 8 Apr 2016 13:11:53 +0000 (16:11 +0300)
commit389b6699a2aa0b457aa69986e9ddf39f3b4030fd
tree51dfe4d9f5d035387c092e70d0fab54ea82d0432
parentcbe4a61d1ddc4790d950ca8c33ef79ee68ef5e2b
stm class: Fix stm device initialization order

Currently, stm_register_device() makes the device visible and then
proceeds to initializing spinlocks and other properties, which leaves
a window when the device can already be opened but is not yet fully
operational.

Fix this by reversing the initialization order.

Reported-by: Alan Cox <alan.cox@intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Laurent Fert <laurent.fert@intel.com>
drivers/hwtracing/stm/core.c