diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-27 10:27:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-12-27 10:27:01 +0100 |
commit | 372c73b469e4d519d5cac7b52defa202668ba8d3 (patch) | |
tree | dfda88f2a45d2a650585ef0ae25eda168221083f /drivers | |
parent | 1bc4deedc2d8c2615feb5c9fa5eb93a9ac38ebe7 (diff) | |
parent | 2da3db7f498d8b6137566b4869d289938b69de13 (diff) |
Merge tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next
Chanwoo writes:
Update extcon next for v5.17
Detailed description for this pull request:
1. Remove duplicate code in extcon_set_state_sync() in extcon core
2. Fix non-kernel-doc comment for extcon-usb-gpio.c
* tag 'extcon-next-for-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon:
extcon: Deduplicate code in extcon_set_state_sync()
extcon: usb-gpio: fix a non-kernel-doc comment
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/extcon/extcon-usb-gpio.c | 2 | ||||
-rw-r--r-- | drivers/extcon/extcon.c | 14 |
2 files changed, 2 insertions, 14 deletions
diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c index 0cb440bdd5cb..f2b65d967384 100644 --- a/drivers/extcon/extcon-usb-gpio.c +++ b/drivers/extcon/extcon-usb-gpio.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only -/** +/* * drivers/extcon/extcon-usb-gpio.c - USB GPIO extcon driver * * Copyright (C) 2015 Texas Instruments Incorporated - https://www.ti.com diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index e7a9561a826d..a09e704fd0fa 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c @@ -576,19 +576,7 @@ EXPORT_SYMBOL_GPL(extcon_set_state); */ int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, bool state) { - int ret, index; - unsigned long flags; - - index = find_cable_index_by_id(edev, id); - if (index < 0) - return index; - - /* Check whether the external connector's state is changed. */ - spin_lock_irqsave(&edev->lock, flags); - ret = is_extcon_changed(edev, index, state); - spin_unlock_irqrestore(&edev->lock, flags); - if (!ret) - return 0; + int ret; ret = extcon_set_state(edev, id, state); if (ret < 0) |