Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/acorn32/mainbus/fd.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/acorn32/mainbus/fd.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.37.6.1 retrieving revision 1.37.6.2 diff -u -p -r1.37.6.1 -r1.37.6.2 --- src/sys/arch/acorn32/mainbus/fd.c 2008/06/02 13:21:43 1.37.6.1 +++ src/sys/arch/acorn32/mainbus/fd.c 2008/06/29 09:32:53 1.37.6.2 @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.37.6.1 2008/06/02 13:21:43 mjf Exp $ */ +/* $NetBSD: fd.c,v 1.37.6.2 2008/06/29 09:32:53 mjf Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.37.6.1 2008/06/02 13:21:43 mjf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.37.6.2 2008/06/29 09:32:53 mjf Exp $"); #include "opt_ddb.h" @@ -560,10 +560,9 @@ fd_dev_to_type(fd, dev) } void -fdstrategy(bp) - register struct buf *bp; /* IO operation to perform */ +fdstrategy(struct buf *bp) { - struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(bp->b_dev)]; + struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(bp->b_dev)); int sz; int s; @@ -792,21 +791,13 @@ out_fdc(iot, ioh, x) } int -fdopen(dev, flags, mode, l) - dev_t dev; - int flags; - int mode; - struct lwp *l; +fdopen(dev_t dev, int flags, int mode, struct lwp *l) { - int unit; struct fd_softc *fd; struct fd_type *type; - unit = FDUNIT(dev); - if (unit >= fd_cd.cd_ndevs) - return ENXIO; - fd = fd_cd.cd_devs[unit]; - if (fd == 0) + fd = device_lookup_private(&fd_cd, FDUNIT(dev)); + if (fd == NULL) return ENXIO; type = fd_dev_to_type(fd, dev); if (type == NULL) @@ -825,13 +816,9 @@ fdopen(dev, flags, mode, l) } int -fdclose(dev, flags, mode, l) - dev_t dev; - int flags; - int mode; - struct lwp *l; +fdclose(dev_t dev, int flags, int mode, struct lwp *l) { - struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; + struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev)); fd->sc_flags &= ~FD_OPEN; fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT); @@ -1313,14 +1300,9 @@ fdcretry(fdc) } int -fdioctl(dev, cmd, addr, flag, l) - dev_t dev; - u_long cmd; - void *addr; - int flag; - struct lwp *l; +fdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l) { - struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; + struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev)); struct fdformat_parms *form_parms; struct fdformat_cmd *form_cmd; struct ne7_fd_formb *fd_formb; @@ -1495,13 +1477,10 @@ fdioctl(dev, cmd, addr, flag, l) } int -fdformat(dev, finfo, l) - dev_t dev; - struct ne7_fd_formb *finfo; - struct lwp *l; +fdformat(dev_t dev, struct ne7_fd_formb *finfo, struct lwp *l) { int rv = 0; - struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)]; + struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(dev)); struct fd_type *type = fd->sc_type; struct buf *bp;