[PATCH v3 1/1] usb: dwc3: Add optional VBUS regulator support to SpacemiT K1
Chukun Pan
amadeus at jmu.edu.cn
Tue Mar 31 06:02:30 PDT 2026
Hi,
> > + if (usb_get_dr_mode(dev) == USB_DR_MODE_HOST) {
> The logic looks good, but the structure can be further improved to better align with
> standard kernel coding style:
>
> if (usb_get_dr_mode(dev) != USB_DR_MODE_HOST)
> return 0;
I initially thought of writing it this way too.
> > + int ret = devm_regulator_get_enable_optional(dev, "vbus");
> Could you please move the declaration of ret to the top of the function?
Thank you for your suggestion. This patch has been merged.
Perhaps it can be revised in the future.
Thanks,
Chukun
More information about the linux-riscv
mailing list