Re: [PATCH] staging: greybus: uart: convert from IDR to XArray
From: Greg KH
Date: Tue Aug 25 2026 - 11:35:34 EST
On Mon, Aug 10, 2026 at 05:10:43PM +0300, Dmitry Priz wrote:
> IDR is deprecated in favor of XArray, which manages its own
> internal locking and provides a more consistent allocation API.
Which is fine, but:
> Convert tty_minors from an IDR to an allocating XArray. Update
> the error check in gb_uart_probe() from -ENOSPC to -EBUSY, since
> that is the error xa_alloc() returns when the allocation range
> is exhausted, unlike idr_alloc() which returned -ENOSPC.
This isn't needed at all. idr is just fine for a minor number
allocation, an xarray is total overkill.
Sorry, but this keeps coming up on the list, what tool made you want to
do this conversion?
> Build-tested and verified via boot in QEMU: the module loads,
> registers with the greybus core, and unloads cleanly.
But you don't actually test it such that this codepath gets used, right?
thanks,
greg k-h