|
|
|
Re: [PATCH v3] USB: Chipidea: add ci13xxx device id management | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
|
Richard Zhao <richard.zhao@xxxxxxxxxxxxx> writes:
> We simply use bitmap to manage the ids.
> Max count of devices CI_DEVS_POSSIBLE is 32.
Actually, I've just noticed ida_simple_get()/ida_simple_remove() and
they look like what we need for this purpose.
So we might as well just
static DEFINE_IDA(ci_ida);
and then in ci13xxx_add_device():
id = ida_simple_get(&ci_ida, 0, 0, GFP_KERNEL);
if (id < 0)
return ERR_PTR(id);
pdev = platform_device_alloc("ci_hdrc", id);
etc. How about that?
Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html

[Linux Media] [Video for Linux] [Linux Input] [Linux Audio Users] [Photo] [Yosemite News] [Yosemite Photos] [Free Online Dating] [Linux Kernel] [Linux SCSI] [Old Linux USB Devel Archive] [More Archives]
![]() |
![]() |