Commit 9eb07977 authored by Robert Jarzmik's avatar Robert Jarzmik Committed by Felipe Balbi

usb: phy: generic: fix the gpios to be optional

All the gpios, ie. reset-gpios and vbus-detect-gpio, should be optional
and not prevent the driver from working. Fix the regression in the
behavior introduced by commit "usb: phy: generic: migrate to gpio_desc".
Signed-off-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Tested-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent b4c2378d
...@@ -218,12 +218,12 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, ...@@ -218,12 +218,12 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
clk_rate = 0; clk_rate = 0;
needs_vcc = of_property_read_bool(node, "vcc-supply"); needs_vcc = of_property_read_bool(node, "vcc-supply");
nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset-gpios"); nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
err = PTR_ERR(nop->gpiod_reset); err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
if (!err) { if (!err) {
nop->gpiod_vbus = devm_gpiod_get_optional(dev, nop->gpiod_vbus = devm_gpiod_get_optional(dev,
"vbus-detect-gpio"); "vbus-detect");
err = PTR_ERR(nop->gpiod_vbus); err = PTR_ERR_OR_ZERO(nop->gpiod_vbus);
} }
} else if (pdata) { } else if (pdata) {
type = pdata->type; type = pdata->type;
...@@ -242,9 +242,11 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, ...@@ -242,9 +242,11 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
if (err == -EPROBE_DEFER) if (err == -EPROBE_DEFER)
return -EPROBE_DEFER; return -EPROBE_DEFER;
if (err) { if (err) {
dev_err(dev, "Error requesting RESET GPIO\n"); dev_err(dev, "Error requesting RESET or VBUS GPIO\n");
return err; return err;
} }
if (nop->gpiod_reset)
gpiod_direction_output(nop->gpiod_reset, 1);
nop->phy.otg = devm_kzalloc(dev, sizeof(*nop->phy.otg), nop->phy.otg = devm_kzalloc(dev, sizeof(*nop->phy.otg),
GFP_KERNEL); GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment