summaryrefslogtreecommitdiff
path: root/common/usb_onboard_hub.c
diff options
context:
space:
mode:
authorLukasz Czechowski <lukasz.czechowski@thaumatec.com>2025-07-22 11:55:34 +0200
committerTom Rini <trini@konsulko.com>2025-07-30 07:57:17 -0600
commit480753ca92352e69a08455ad487089388fac9d88 (patch)
treeca197287e982cd9ef329604a3d7afc88e24e6015 /common/usb_onboard_hub.c
parenta4446e13dba65f2e56e0d7a97875f76e5199015c (diff)
usb: onboard-hub: Use devm API do automatically free the reset GPIO
The reset GPIO is obtained during driver probing by the function devm_gpiod_get_optional, which means the GPIO will be automatically freed when the device is removed. Because of this, explicit call to free the reset GPIO in hub remove function is not needed. To support the Managed device resources, the DEVRES config must be enabled, otherwise the devres functions fall back to non-managed variants. Set the necessary dependency to DEVRES in Kconfig. Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Diffstat (limited to 'common/usb_onboard_hub.c')
-rw-r--r--common/usb_onboard_hub.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/common/usb_onboard_hub.c b/common/usb_onboard_hub.c
index 7606362a4ee..c6379192fe8 100644
--- a/common/usb_onboard_hub.c
+++ b/common/usb_onboard_hub.c
@@ -211,9 +211,6 @@ static int usb_onboard_hub_remove(struct udevice *dev)
struct onboard_hub *hub = dev_get_priv(dev);
int ret = 0;
- if (hub->reset_gpio)
- dm_gpio_free(hub->reset_gpio->dev, hub->reset_gpio);
-
if (hub->vdd) {
ret = regulator_set_enable_if_allowed(hub->vdd, false);
if (ret)