[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210427193740.GB11046@user>
Date: Wed, 28 Apr 2021 01:07:40 +0530
From: SAURAV GIREPUNJE <saurav.girepunje@...il.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: b-liu@...com, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org, saurav.girepunje@...mail.com
Subject: Re: [PATCH] usb: musb: davinci: change the variable type
On Thu, Apr 22, 2021 at 10:49:10AM +0200, Greg KH wrote:
> On Mon, Apr 19, 2021 at 12:06:18AM +0530, Saurav Girepunje wrote:
> > vbus_state is define as bool but on davinci.c assigning a value
> > '-1' to the bool variable.
>
> Does it also test that value?
>
> If so, shouldn't that logic error be fixed instead of working around it
> by changing the variable type?
>
> This feels wrong...
>
> thanks,
>
> greg k-h
vbus_state is assign with the value of "-1" in davinci.c file.
However it check value whether it is zero or a non-zero.
This value pass On gpio lib function.Which need this value to bool only.
On below "glue->vbus_state" should be 1.
glue->vbus = devm_gpiod_get_optional(&pdev->dev, NULL, GPIOD_OUT_LOW);
if (IS_ERR(glue->vbus)) {
ret = PTR_ERR(glue->vbus);
goto err0;
} else {
glue->vbus_state = -1;
INIT_WORK(&glue->vbus_work, evm_deferred_drvvbus);
}
Powered by blists - more mailing lists