lkml.org 
[lkml]   [2023]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: rfkill: gpio: set GPIO direction
From
Date
Hi Johannes,

On Wed, 2023-12-06 at 14:16 +0100, Johannes Berg wrote:
> On Wed, 2023-12-06 at 14:13 +0100, Rouven Czerwinski wrote:
> >
> > +++ b/net/rfkill/rfkill-gpio.c
> > @@ -126,6 +126,16 @@ static int rfkill_gpio_probe(struct
> > platform_device *pdev)
> >   return -EINVAL;
> >   }
> >  
> > + if (rfkill->reset_gpio)
> > + ret = gpiod_direction_output(rfkill->reset_gpio,
> > true);
> > + if (ret)
> > + return ret;
> > +
> > + if (rfkill->shutdown_gpio)
> > + ret = gpiod_direction_output(rfkill-
> > >shutdown_gpio, true);
> > + if (ret)
> > + return ret;
> >
>
> That's weird, you need ret to be inside the if. It's even entirely
> uninitialized if you don't have ACPI, if you don't have
> reset/shutdown.

Thanks for the review, you are totally right, I didn't look at the ret
initialization. I moved it inside the if for v2.

Thanks,
Rouven

\
 
 \ /
  Last update: 2023-12-06 14:25    [W:0.098 / U:19.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site