Re: [PATCH 1/2] extcon: fix hang and extcon_get/set_cable_state().

2015-07-07 Thread Roger Quadros
Hi, On 07/07/15 15:40, Ivan T. Ivanov wrote: On Mon, 2015-07-06 at 17:46 +0300, Roger Quadros wrote: -static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) +static int find_cable_id_by_name(struct extcon_dev *edev, const char *name) { - unsigned int id = EXTC

Re: [PATCH 1/2] extcon: fix hang and extcon_get/set_cable_state().

2015-07-07 Thread Ivan T. Ivanov
On Mon, 2015-07-06 at 17:46 +0300, Roger Quadros wrote: > > -static int find_cable_index_by_name(struct extcon_dev *edev, const char > *name) > +static int find_cable_id_by_name(struct extcon_dev *edev, const char *name) > { > - unsigned int id = EXTCON_NONE; > + unsigned int id =

[PATCH 1/2] extcon: fix hang and extcon_get/set_cable_state().

2015-07-06 Thread Roger Quadros
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 (cabl