diff options
author | Roger Quadros <rogerq@ti.com> | 2015-07-07 16:06:15 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2015-07-31 10:08:47 +0900 |
commit | be052cc87745e01846fb036eb81567c784439078 (patch) | |
tree | a730360e39f24ab9b75fb930eecc615d21e0baca /drivers/hwmon/ultra45_env.c | |
parent | e350f8045f642dfc4c28a81c57d2103e1f7ceead (diff) |
extcon: Fix hang and extcon_get/set_cable_state().
Users of find_cable_index_by_name() will cause a kernel hang
as the while loop counter is never incremented and end condition
is never reached.
extcon_get_cable_state() and extcon_set_cable_state() are broken
because they use cable index instead of cable id. This causes
the first cable state (cable.0) to be always invalid in sysfs
or extcon_get_cable_state() users.
Introduce a new function find_cable_id_by_name() that fixes
both of the above issues.
Fixes: commit 73b6ecdb93e8 ("extcon: Redefine the unique id of supported external connectors without 'enum extcon' type")
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Tested-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
[cw00.choi: Fix minor coding style]
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/hwmon/ultra45_env.c')
0 files changed, 0 insertions, 0 deletions