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/zaurus | |
parent | a258f20b10975f2a073d3fbeb33358967ff5298c (diff) |
make findblkmajor() and findblkname() MI; ok miod
Diffstat (limited to 'sys/arch/zaurus')
-rw-r--r-- | sys/arch/zaurus/zaurus/autoconf.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/sys/arch/zaurus/zaurus/autoconf.c b/sys/arch/zaurus/zaurus/autoconf.c index d41e95edcf8..a807f8543c6 100644 --- a/sys/arch/zaurus/zaurus/autoconf.c +++ b/sys/arch/zaurus/zaurus/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.8 2007/05/04 03:44:44 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.9 2007/05/04 19:30:55 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ /* @@ -138,36 +138,11 @@ cpu_configure(void) } -static struct { - char *name; - int maj; -} nam2blk[] = { +struct nam2blk nam2blk[] = { { "wd", 16 }, { "sd", 24 }, { "cd", 26 }, { "rd", 18 }, - { "raid", 71 } + { "raid", 71 }, + { 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); -} |