linux_old1/drivers/extcon
Roger Quadros be052cc877 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 73b6ecdb93 ("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>
2015-07-31 10:08:47 +09:00
..
Kconfig extcon: Allow compile test of GPIO consumers if !GPIOLIB 2015-05-19 16:39:06 +09:00
Makefile extcon: axp288: Add axp288 extcon driver support 2015-05-19 16:39:04 +09:00
extcon-adc-jack.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-arizona.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-axp288.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-gpio.c extcon: Remove the optional name of extcon device 2015-05-19 16:39:06 +09:00
extcon-max8997.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-max14577.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-max77693.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-max77843.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-palmas.c extcon: palmas: Fix NULL pointer error 2015-07-29 17:55:53 +09:00
extcon-rt8973a.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-rt8973a.h extcon: rt8973a: Add Richtek RT8973A extcon driver 2014-09-22 11:43:08 +09:00
extcon-sm5502.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon-sm5502.h extcon: sm5502: Move sm5502.h header file to extcon directory 2014-09-22 11:43:08 +09:00
extcon-usb-gpio.c extcon: Redefine the unique id of supported external connectors without 'enum extcon' type 2015-06-12 17:01:42 -07:00
extcon.c extcon: Fix hang and extcon_get/set_cable_state(). 2015-07-31 10:08:47 +09:00