lkml.org 
[lkml]   [2019]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4 6/6] usb: ohci-da8xx: drop the vbus GPIO
From
Date
Hi Bartosz,

On 11/04/19 3:00 PM, Bartosz Golaszewski wrote:
> @@ -209,9 +197,7 @@ static irqreturn_t ohci_da8xx_oc_thread(int irq, void *data)
> int ret;
>
> if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio)) {
> - if (da8xx_ohci->vbus_gpio) {
> - gpiod_set_value_cansleep(da8xx_ohci->vbus_gpio, 0);
> - } else if (da8xx_ohci->vbus_reg) {
> + if (da8xx_ohci->vbus_reg) {
> ret = regulator_disable(da8xx_ohci->vbus_reg);
> if (ret)
> dev_err(dev,

You can now reduce a level of indentation here by doing

if (gpiod_get_value_cansleep(da8xx_ohci->oc_gpio) &&
da8xx_ohci->vbus_reg) {
ret = regulator_disable(da8xx_ohci->vbus_reg);
if (ret)
dev_err(dev, "Failed to disable regulator: %d\n",
ret);
}

Thanks
Sekhar

\
 
 \ /
  Last update: 2019-04-12 12:33    [W:0.120 / U:3.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site