diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-04 19:30:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-05-04 19:30:56 +0000 |
commit | e3d438608f212120e42a6447bf89f354816ac4ff (patch) | |
tree | 0ef9e295d96f14d2180ea27daa273afdb5b093d1 /sys/arch/sparc64 | |
parent | a258f20b10975f2a073d3fbeb33358967ff5298c (diff) |
make findblkmajor() and findblkname() MI; ok miod
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/autoconf.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 56b3b02322a..74c1b8a55f2 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.64 2007/05/04 03:44:44 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.65 2007/05/04 19:30:55 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -1155,36 +1155,11 @@ nail_bootdev(dev, bp) bootpath_store(1, NULL); } -struct nam2blk { - char *name; - int maj; -} nam2blk[] = { +struct nam2blk nam2blk[] = { { "sd", 7 }, { "rd", 5 }, { "wd", 12 }, { "cd", 18 }, { "raid", 25 }, + { NULL, -1 } }; - -int -findblkmajor(struct device *dv) -{ - char *name = dv->dv_xname; - int i; - - for (i = 0; i < sizeof(nam2blk)/sizeof(nam2blk[0]); i++) - if (!strncmp(name, nam2blk[i].name, strlen(nam2blk[i].name))) - return (nam2blk[i].maj); - return (-1); -} - -char * -findblkname(int maj) -{ - int i; - - for (i = 0; i < sizeof(nam2blk)/sizeof(nam2blk[0]); i++) - if (nam2blk[i].maj == maj) - return (nam2blk[i].name); - return (NULL); -} |