Skip to content

Commit f4cce69

Browse files
chanwoochoigregkh
authored andcommitted
Extcon: Notify changed state for only one cable to notifee
This patch inform the state of only one cable instead of previous data including the state of 32 cables to notifee which use extcon_register_interest() function to monitor whether the specific cable is attachd or detached. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a1d26ac commit f4cce69

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎drivers/extcon/extcon_class.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,15 @@ static int _call_per_cable(struct notifier_block *nb, unsigned long val,
425425

426426
if ((val & (1 << obj->cable_index)) !=
427427
(edev->state & (1 << obj->cable_index))) {
428+
bool cable_state = true;
429+
428430
obj->previous_value = val;
429-
return obj->user_nb->notifier_call(obj->user_nb, val, ptr);
431+
432+
if (val & (1 << obj->cable_index))
433+
cable_state = false;
434+
435+
return obj->user_nb->notifier_call(obj->user_nb,
436+
cable_state, ptr);
430437
}
431438

432439
return NOTIFY_OK;

0 commit comments

Comments
 (0)