Skip to content

Commit

Permalink
usb: misc: onboard_usb_hub: Drop reset delay in onboard_hub_power_off()
Browse files Browse the repository at this point in the history
onboard_hub_power_off() currently has a delay after asserting the
reset of the hub. There is already a delay in onboard_hub_power_on()
before de-asserting the reset, which ensures that the reset is
asserted for the required time, so the delay in _power_off() is not
needed.

Skip the reset GPIO check before calling gpiod_set_value_cansleep(),
the function returns early when the GPIO descriptor is NULL.

Reviewed-By: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Link: https://lore.kernel.org/r/20220805111836.1.Id5a4dc0a2c046236116693aa55672295513a0f2a@changeid
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Matthias Kaehlcke authored and Greg Kroah-Hartman committed Aug 18, 2022
1 parent 040f2db commit 1bcafc0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/usb/misc/onboard_usb_hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ static int onboard_hub_power_off(struct onboard_hub *hub)
{
int err;

if (hub->reset_gpio) {
gpiod_set_value_cansleep(hub->reset_gpio, 1);
fsleep(hub->pdata->reset_us);
}
gpiod_set_value_cansleep(hub->reset_gpio, 1);

err = regulator_disable(hub->vdd);
if (err) {
Expand Down

0 comments on commit 1bcafc0

Please sign in to comment.