aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon_class.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/extcon/extcon_class.c')
-rw-r--r--drivers/extcon/extcon_class.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
index 53c64a98b0b..4657ad38164 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -425,8 +425,15 @@ static int _call_per_cable(struct notifier_block *nb, unsigned long val,
425 425
426 if ((val & (1 << obj->cable_index)) != 426 if ((val & (1 << obj->cable_index)) !=
427 (edev->state & (1 << obj->cable_index))) { 427 (edev->state & (1 << obj->cable_index))) {
428 bool cable_state = true;
429
428 obj->previous_value = val; 430 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);
430 } 437 }
431 438
432 return NOTIFY_OK; 439 return NOTIFY_OK;