aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2015-01-30 11:22:45 -0500
committerFelipe Balbi <balbi@ti.com>2015-01-30 11:35:15 -0500
commit9eb0797722895f4309b46d122e24d87ad17f473b (patch)
treecc5639de313674a7c323410affa034d20638a7e9
parentb4c2378df6419b81eefcb9cd56726321c29a70ca (diff)
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: Robert Jarzmik <robert.jarzmik@free.fr> Tested-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--drivers/usb/phy/phy-generic.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index 9a826ff31951..bdb4cb3920f1 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -218,12 +218,12 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
218 clk_rate = 0; 218 clk_rate = 0;
219 219
220 needs_vcc = of_property_read_bool(node, "vcc-supply"); 220 needs_vcc = of_property_read_bool(node, "vcc-supply");
221 nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset-gpios"); 221 nop->gpiod_reset = devm_gpiod_get_optional(dev, "reset");
222 err = PTR_ERR(nop->gpiod_reset); 222 err = PTR_ERR_OR_ZERO(nop->gpiod_reset);
223 if (!err) { 223 if (!err) {
224 nop->gpiod_vbus = devm_gpiod_get_optional(dev, 224 nop->gpiod_vbus = devm_gpiod_get_optional(dev,
225 "vbus-detect-gpio"); 225 "vbus-detect");
226 err = PTR_ERR(nop->gpiod_vbus); 226 err = PTR_ERR_OR_ZERO(nop->gpiod_vbus);
227 } 227 }
228 } else if (pdata) { 228 } else if (pdata) {
229 type = pdata->type; 229 type = pdata->type;
@@ -242,9 +242,11 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop,
242 if (err == -EPROBE_DEFER) 242 if (err == -EPROBE_DEFER)
243 return -EPROBE_DEFER; 243 return -EPROBE_DEFER;
244 if (err) { 244 if (err) {
245 dev_err(dev, "Error requesting RESET GPIO\n"); 245 dev_err(dev, "Error requesting RESET or VBUS GPIO\n");
246 return err; 246 return err;
247 } 247 }
248 if (nop->gpiod_reset)
249 gpiod_direction_output(nop->gpiod_reset, 1);
248 250
249 nop->phy.otg = devm_kzalloc(dev, sizeof(*nop->phy.otg), 251 nop->phy.otg = devm_kzalloc(dev, sizeof(*nop->phy.otg),
250 GFP_KERNEL); 252 GFP_KERNEL);