Re: [PATCH 6/8] platform/x86: x86-android-tablets: Stop using gpiolib private APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On 9/11/23 14:56, Andy Shevchenko wrote:
> On Mon, Sep 11, 2023 at 02:49:44PM +0200, Bartosz Golaszewski wrote:
>> On Sun, Sep 10, 2023 at 1:26 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>>> On 9/10/23 10:24, Andy Shevchenko wrote:
>>>> On Sat, Sep 9, 2023 at 5:18 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
> 
> ...
> 
>>>>> +       gpiod = devm_gpiod_get(&x86_android_tablet_device->dev, con_id, dflags);
> 
> ^^^
> 
>>>>> -       *desc = gpiod;
>>>>> +       if (desc)
>>>>> +               *desc = gpiod;
>>>>
>>>> Are we expecting that callers may not want the GPIO descriptor out of
>>>> this function?
>>>> Sounds a bit weird if so.
>>>
>>> Yes specifically the Charge-enable and OTG (Vboost enable) pins on the
>>> bq25892 charger on the Lenovo Yoga Tab 3 just need to be set to a fixed
>>> value, so we request the pins with GPIOD_OUT_LOW / _HIGH and then
>>> leave them at that value.
>>
>> You mean you leak the descriptor? It would warrant either a comment or
>> storing the descriptor somewhere and cleaning it up if the device can
>> be unbound (I guess it can since the driver can be built as module).
> 
> Note devm_*() above.

Right, the GPIOs will be free-ed on unbound through the devm framework.

Regards,

Hans




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]
  Powered by Linux