During probing a extcon-max77693 driver, extcon-port driver can't receive nb
callback due to initializing sequences.
Thus, if the callback can't be handled, we do not update the cable state.
I'm not sure this patch is good solution :)
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
int env_offset = 0;
int length;
unsigned long flags;
+ int ret;
spin_lock_irqsave(&edev->lock, flags);
edev->state &= ~mask;
edev->state |= state & mask;
- raw_notifier_call_chain(&edev->nh, old_state, edev);
+ ret = raw_notifier_call_chain(&edev->nh, old_state, edev);
+ if ((ret & ~NOTIFY_STOP_MASK) != NOTIFY_OK) {
+ edev->state = old_state;
+ spin_unlock_irqrestore(&edev->lock, flags);
+ return -ENODEV;
+ }
/* This could be in interrupt handler */
prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);