extcon: axp288: Simplify axp288_handle_chrg_det_event
authorHans de Goede <hdegoede@redhat.com>
Mon, 19 Dec 2016 00:13:08 +0000 (01:13 +0100)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 9 Jan 2017 01:04:10 +0000 (10:04 +0900)
commit3fe1e0e2ab509863c1e9809a085508d8bce3e079
tree9052aec883ac2d545a2fcf8c39127d718a75c494
parent1490d157e0759b12913cc0d3b734a03bbcb8cb61
extcon: axp288: Simplify axp288_handle_chrg_det_event

axp288_handle_chrg_det_event only gets called on change interrupts
(so not that often), extcon_set_state_sync() checks itself if there are
any actual changes before notifying listeners, and gpiod_set_value is
not really expensive either.

So we can simply always do both on each interrupt removing a bunch of
somewhat magic looking code from axp288_handle_chrg_det_event.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
drivers/extcon/extcon-axp288.c