On Tue, Apr 29, 2025 at 5:08 PM Thomas Richard
<[email protected]> wrote:
>
> Add request() callback to check if the GPIO descriptor was well registered
> in the gpiochip_fwd before to use it. This is done to handle the case

to use --> using

> where GPIO descriptor is added at runtime in the forwarder.
>
> If at least one GPIO descriptor was not added before the forwarder
> registration, we assume the forwarder can sleep as if a GPIO is added at
> runtime it may sleep.

...

> +       /*
> +        * get_direction() is called during gpiochip registration, return 
> input
> +        * direction if there is no descriptor for the line

Missing period at the end.

> +        */

...

> -       if (fwd->descs[offset])
> +       if (test_and_set_bit(offset, fwd->valid_mask))
>                 return -EEXIST;

Here you should add the entire conditional and not in the one of the
previous patches.

...

> +       /*
> +        * Some gpio_desc were not registered. They will be registered at 
> runtime
> +        * but we have to suppose they can sleep.
> +        */

> +       if (bitmap_full(fwd->valid_mask, chip->ngpio))

I think I don't get this check. The bitmap_full() returns true if and
only if _all_ bits up to the nbits are set. In accordance with the
comment it seems you wanted something different (an opposite?).

> +               chip->can_sleep = true;

-- 
With Best Regards,
Andy Shevchenko

Reply via email to