Paul Zimmerman <paul.zimmer...@synopsys.com> writes:
> The patch below fixes it. And it seems like the right thing to me,
> since GPIOs should be optional for a generic phy, I would think. But
> my device tree foo is very weak, so I'm not sure.
>
> CCing Robert, who touched the generic phy code last. Robert, what do
> you think?
I think your patch in [1] is correct, because
"Documentation/devicetree/bindings/usb/usb-nop-xceiv.txt" states that
reset-gpios is optional, and because Felipe told me gpios for phy_generic are
optional.

Now the original code was written by Felipe, so better ask him first. The
original code was :
af9f51c55 phy-generic.c nop->gpio_reset = of_get_named_gpio_flags(node, 
"reset-gpios",
af9f51c55 phy-generic.c                                                 0, 
&flags);
af9f51c55 phy-generic.c if (nop->gpio_reset == -EPROBE_DEFER)
af9f51c55 phy-generic.c         return -EPROBE_DEFER;

Cheers.

--
Robert

[1]
> diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
> index dd05254..9a826ff 100644
> --- a/drivers/usb/phy/phy-generic.c
> +++ b/drivers/usb/phy/phy-generic.c
> @@ -218,10 +218,10 @@ int usb_phy_gen_create_phy(struct device *dev, struct 
> usb_phy_generic *nop,
>                       clk_rate = 0;
>  
>               needs_vcc = of_property_read_bool(node, "vcc-supply");
> -             nop->gpiod_reset = devm_gpiod_get(dev, "reset-gpios");
> +             nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset-gpios");
>               err = PTR_ERR(nop->gpiod_reset);
>               if (!err) {
> -                     nop->gpiod_vbus = devm_gpiod_get(dev,
> +                     nop->gpiod_vbus = devm_gpiod_get_optional(dev,
>                                                        "vbus-detect-gpio");
>                       err = PTR_ERR(nop->gpiod_vbus);
>               }
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to