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:
ache 2001-11-01 05:07:28 +00:00
parent 8e6deccca7
commit 111cac0e80

View File

@ -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)
{