Hans de Goede <hdegoede@xxxxxxxxxx> writes: > Thanks this change looks good to me. > >> @@ -247,8 +249,10 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc, >> if (IS_ERR(gpio)) >> return PTR_ERR(gpio); >> >> - gpiod_set_value_cansleep(gpio, 1); >> - gpiod_put(gpio); >> + if (gpio) { >> + gpiod_set_value_cansleep(gpio, 1); >> + gpiod_put(gpio); >> + } >> >> gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); >> if (IS_ERR(gpio)) > > But this is not necessary both gpiod_set_value_cansleep() and gpiod_put() handle being called with NULL gracefully (so they handle NULL returned by gpiod_get_optional() without issues) . > > Can you please post a version 2 of this patch dropping this unnecessary change? V2 posted: https://lore.kernel.org/linux-usb/20230726184555.218091-2-gratian.crisan@xxxxxx/ Thanks, Gratian