]> git.baikalelectronics.ru Git - kernel.git/commit
iio:light:stk3310: move device register to end of probe
authorHartmut Knaack <knaack.h@gmx.de>
Thu, 9 Jul 2015 21:51:29 +0000 (23:51 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 19 Jul 2015 13:53:16 +0000 (14:53 +0100)
commite6d9c0b3817d0f280f1981e057359cac6f1d577b
tree54ee1dfff326d82657179b66261350c000a6b567
parent6661ab86d3aa79d245e81ce2e2ecf49b19cb24ff
iio:light:stk3310: move device register to end of probe

iio_device_register should be the last operation during probe. Therefor
move up interrupt setup code and while at it, change the check for invalid
values of client->irq to be smaller than zero.
Fixes: 3e8fd064b203 ("iio: light: Add threshold interrupt support for STK3310")
As the device_register makes the userspace interfaces of the device available
it is possible for requests to come in before the probe sequence has finished.
This can lead to unhandled interrupts and similar.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Reviewed-by: Tiberiu Breana <tiberiu.a.breana@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/stk3310.c