Add new interface function
int devclass_find_free_unit(devclass_t dc, int unit); which return first free unit in given class starting from 'unit'.
This commit is contained in:
parent
8e6deccca7
commit
111cac0e80
@ -341,6 +341,16 @@ devclass_get_maxunit(devclass_t dc)
|
||||
return (dc->maxunit);
|
||||
}
|
||||
|
||||
int
|
||||
devclass_find_free_unit(devclass_t dc, int unit)
|
||||
{
|
||||
if (dc == NULL)
|
||||
return (unit);
|
||||
while (unit < dc->maxunit && dc->devices[unit] != NULL)
|
||||
unit++;
|
||||
return (unit);
|
||||
}
|
||||
|
||||
static int
|
||||
devclass_alloc_unit(devclass_t dc, int *unitp)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user