]> git.baikalelectronics.ru Git - kernel.git/commit
extcon: Fix extcon_cable_get_state() from getting old state after notification
authorRoger Quadros <rogerq@ti.com>
Mon, 6 Jul 2015 14:46:58 +0000 (17:46 +0300)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 31 Jul 2015 06:18:41 +0000 (15:18 +0900)
commited1fcc1fd2a19074584344261b5d87e3dd1b21c2
tree58c9f79a9b713efb39c1507b9dafa64f4a616f4b
parent3bda8f1d43262384f8ec7a3be3d517ff5381abe0
extcon: Fix extcon_cable_get_state() from getting old state after notification

Currently the extcon code notifiers the interested listeners
before it updates the extcon state with the new state.
This will cause the listeners that use extcon_cable_get_state()
to get the stale state and loose the new state.

Fix this by first changing the extcon state variable and then
notifying listeners.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Tested-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon.c