mfd: Use gpio_request_one from omap-usb-host
authorAxel Lin <axel.lin@gmail.com>
Thu, 1 Dec 2011 01:53:25 +0000 (09:53 +0800)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 8 Jan 2012 23:37:38 +0000 (00:37 +0100)
Use gpio_request_one() instead of multiple gpiolib calls.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/omap-usb-host.c

index 86e14583a08276fd7f76dddd3afe3433f1dfa9a8..6533ecc716787e1c81bebee4c4221079284fe098 100644 (file)
@@ -715,19 +715,13 @@ static int usbhs_enable(struct device *dev)
        clk_enable(omap->usbtll_ick);
 
        if (pdata->ehci_data->phy_reset) {
-               if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0])) {
-                       gpio_request(pdata->ehci_data->reset_gpio_port[0],
-                                               "USB1 PHY reset");
-                       gpio_direction_output
-                               (pdata->ehci_data->reset_gpio_port[0], 0);
-               }
+               if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[0]))
+                       gpio_request_one(pdata->ehci_data->reset_gpio_port[0],
+                                        GPIOF_OUT_INIT_LOW, "USB1 PHY reset");
 
-               if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1])) {
-                       gpio_request(pdata->ehci_data->reset_gpio_port[1],
-                                               "USB2 PHY reset");
-                       gpio_direction_output
-                               (pdata->ehci_data->reset_gpio_port[1], 0);
-               }
+               if (gpio_is_valid(pdata->ehci_data->reset_gpio_port[1]))
+                       gpio_request_one(pdata->ehci_data->reset_gpio_port[1],
+                                        GPIOF_OUT_INIT_LOW, "USB2 PHY reset");
 
                /* Hold the PHY in RESET for enough time till DIR is high */
                udelay(10);