Re: [PATCH 2/6] gpiolib: free the label of lines released after their chip was removed
From: Adrian Ambrozewicz
Date: Fri Oct 16 2026 - 03:52:20 EST
On Tue, Oct 13, 2026 at 06:38:38PM +0300, Andy Shevchenko wrote:
> I have two questions here.
>
> 1/ Do we still need to notify user space in the case of the chip gone?
No. The notification goes to the chip's character device files that
watch the line, and once the chip is gone read() on them returns
-ENODEV, so the event could not be delivered. It is not sent in that
case today either, and the patch keeps it that way.
> 2/ Can we write the above as
>
> if (guard.gc && !test_bit(GPIOD_FLAG_REQUESTED, &flags))
> return;
>
> desc_set_label(desc, NULL);
>
> if (guard_gc) {
> ...current code...
> }
Yes, v2 will look like that. The label is then cleared before ->free()
rather than after it. A requested line already shows no label for a
moment today, between desc_set_label() and the flags update, so I
don't think that matters, but say if you would rather keep the order.
Adrian