Use device_is_a() more.
This commit is contained in:
parent
9d54e15b94
commit
8ac4586816
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: x86_autoconf.c,v 1.11 2006/02/26 06:12:59 thorpej Exp $ */
|
||||
/* $NetBSD: x86_autoconf.c,v 1.12 2006/02/26 06:15:01 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -67,15 +67,14 @@ int x86_ndisks;
|
|||
static int
|
||||
is_valid_disk(struct device *dv)
|
||||
{
|
||||
const char *name;
|
||||
|
||||
if (device_class(dv) != DV_DISK)
|
||||
return (0);
|
||||
|
||||
name = dv->dv_cfdata->cf_name;
|
||||
|
||||
return (strcmp(name, "sd") == 0 || strcmp(name, "wd") == 0 ||
|
||||
strcmp(name, "ld") == 0 || strcmp(name, "ed") == 0);
|
||||
return (device_is_a(dev, "sd") ||
|
||||
device_is_a(dev, "wd") ||
|
||||
device_is_a(dev, "ld") ||
|
||||
device_is_a(dev, "ed"));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -146,7 +145,7 @@ matchbiosdisks(void)
|
|||
/* XXXJRT why not just dv_xname?? */
|
||||
snprintf(x86_alldisks->dl_nativedisks[n].ni_devname,
|
||||
sizeof(x86_alldisks->dl_nativedisks[n].ni_devname),
|
||||
"%s%d", dv->dv_cfdata->cf_name, dv->dv_unit);
|
||||
"%s", dv->dv_xname);
|
||||
|
||||
bmajor = devsw_name2blk(dv->dv_xname, NULL, 0);
|
||||
if (bmajor == -1)
|
||||
|
@ -462,7 +461,7 @@ findroot(void)
|
|||
if (device_class(dv) != DV_DISK)
|
||||
continue;
|
||||
|
||||
if (strcmp(dv->dv_cfdata->cf_name, "fd") == 0) {
|
||||
if (device_is_a(dv, "fd")) {
|
||||
/*
|
||||
* Assume the configured unit number matches
|
||||
* the BIOS device number. (This is the old
|
||||
|
|
Loading…
Reference in New Issue