Re: [PATCH v2 4/6] gpio: cdev: put emitting the line state events on a workqueue
From: Bartosz Golaszewski
Date: Mon Oct 14 2024 - 03:47:41 EST
On Mon, Oct 14, 2024 at 4:09 AM Kent Gibson <warthog618@xxxxxxxxx> wrote:
>
> > +
> > + scoped_guard(srcu, &ctx->gdev->srcu) {
> > + gc = srcu_dereference(ctx->gdev->chip, &ctx->gdev->srcu);
> > + if (!gc)
> > + return;
> > +
> > + /*
> > + * We're doing this late because it's a sleeping function. Pin
> > + * functions are in general much more static and while it's not
> > + * 100% bullet-proof, it's good enough for most cases.
> > + */
> > + if (!pinctrl_gpio_can_use_line(gc, ctx->chg.info.offset))
> > + ctx->chg.info.flags |= GPIO_V2_LINE_FLAG_USED;
> > + }
> > +
>
> This block should be conditional on GPIO_V2_LINE_FLAG_USED not already
> being set - most of the time it will be and then this is pointless work.
>
Good point, thanks!
Bart