Use device_unit().
This commit is contained in:
parent
376a595f60
commit
21374641a5
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fd.c,v 1.24 2006/02/23 05:37:46 thorpej Exp $ */
|
||||
/* $NetBSD: fd.c,v 1.25 2006/03/26 04:32:33 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -89,7 +89,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.24 2006/02/23 05:37:46 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.25 2006/03/26 04:32:33 thorpej Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
|
||||
|
@ -412,7 +412,7 @@ fdcattach(parent, self, aux)
|
|||
* The NVRAM info only tells us about the first two disks on the
|
||||
* `primary' floppy controller.
|
||||
*/
|
||||
if (fdc->sc_dev.dv_unit == 0)
|
||||
if (device_unit(&fdc->sc_dev) == 0)
|
||||
type = mc146818_read(NULL, NVRAM_DISKETTE); /* XXX softc */
|
||||
else
|
||||
type = -1;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: if_ade.c,v 1.25 2005/12/24 21:44:28 perry Exp $ */
|
||||
/* $NetBSD: if_ade.c,v 1.26 2006/03/26 04:33:34 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* NOTE: this version of if_de was modified for bounce buffers prior
|
||||
|
@ -81,7 +81,7 @@
|
|||
#define LCLDMA 1
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ade.c,v 1.25 2005/12/24 21:44:28 perry Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: if_ade.c,v 1.26 2006/03/26 04:33:34 thorpej Exp $");
|
||||
|
||||
#include "opt_inet.h"
|
||||
#include "opt_ns.h"
|
||||
|
@ -5021,7 +5021,7 @@ tulip_pci_attach(
|
|||
#if defined(__NetBSD__)
|
||||
tulip_softc_t * const sc = (tulip_softc_t *) self;
|
||||
struct pci_attach_args * const pa = (struct pci_attach_args *) aux;
|
||||
const int unit = sc->tulip_dev.dv_unit;
|
||||
const int unit = device_unit(&sc->tulip_dev);
|
||||
#ifdef THIS_IS_THE_ORIGINAL_HRH_DRIVER_USING_THE_NOW_DEFUNCT_PCI_MEM_FIND
|
||||
bus_addr_t regbase;
|
||||
bus_size_t regsize;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fd.c,v 1.66 2005/12/11 12:16:28 christos Exp $ */
|
||||
/* $NetBSD: fd.c,v 1.67 2006/03/26 04:35:37 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Christian E. Hopps
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.66 2005/12/11 12:16:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.67 2006/03/26 04:35:37 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -1586,7 +1586,7 @@ fddone(struct fd_softc *sc)
|
|||
|
||||
biodone(bp);
|
||||
nobuf:
|
||||
fdfindwork(sc->sc_dv.dv_unit);
|
||||
fdfindwork(device_unit(&sc->sc_dv));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: mfc.c,v 1.38 2005/12/11 12:16:28 christos Exp $ */
|
||||
/* $NetBSD: mfc.c,v 1.39 2006/03/26 04:35:37 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990 The Regents of the University of California.
|
||||
|
@ -58,7 +58,7 @@
|
|||
#include "opt_kgdb.h"
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.38 2005/12/11 12:16:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: mfc.c,v 1.39 2006/03/26 04:35:37 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -370,7 +370,7 @@ mfcattach(struct device *pdp, struct device *dp, void *auxp)
|
|||
printf ("\n");
|
||||
|
||||
scc = (struct mfc_softc *)dp;
|
||||
unit = scc->sc_dev.dv_unit;
|
||||
unit = device_unit(&scc->sc_dev);
|
||||
scc->sc_regs = rp = zap->va;
|
||||
if (zap->prodid == 18)
|
||||
scc->mfc_iii = 3;
|
||||
|
@ -964,7 +964,7 @@ mfcintr(void *arg)
|
|||
istat = regs->du_isr & scc->imask;
|
||||
if (istat == 0)
|
||||
return (0);
|
||||
unit = scc->sc_dev.dv_unit * 2;
|
||||
unit = device_unit(&scc->sc_dev) * 2;
|
||||
if (istat & 0x02) { /* channel A receive interrupt */
|
||||
sc = mfcs_cd.cd_devs[unit];
|
||||
while (1) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: msc.c,v 1.31 2005/12/11 12:16:28 christos Exp $ */
|
||||
/* $NetBSD: msc.c,v 1.32 2006/03/26 04:35:37 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
|
||||
|
@ -93,7 +93,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.31 2005/12/11 12:16:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: msc.c,v 1.32 2006/03/26 04:35:37 thorpej Exp $");
|
||||
|
||||
#include "msc.h"
|
||||
|
||||
|
@ -252,7 +252,7 @@ mscattach(struct device *pdp, struct device *dp, void *auxp)
|
|||
int Count;
|
||||
|
||||
zap = (struct zbus_args *)auxp;
|
||||
unit = dp->dv_unit;
|
||||
unit = device_unit(dp);
|
||||
|
||||
/*
|
||||
* Make config msgs look nicer.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: par.c,v 1.31 2005/12/11 12:16:28 christos Exp $ */
|
||||
/* $NetBSD: par.c,v 1.32 2006/03/26 04:35:37 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1990 The Regents of the University of California.
|
||||
|
@ -32,7 +32,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: par.c,v 1.31 2005/12/11 12:16:28 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: par.c,v 1.32 2006/03/26 04:35:37 thorpej Exp $");
|
||||
|
||||
/*
|
||||
* parallel port interface
|
||||
|
@ -207,7 +207,7 @@ parstart(void *arg)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pardebug & PDB_FOLLOW)
|
||||
printf("parstart(%x)\n", sc->sc_dev.dv_unit);
|
||||
printf("parstart(%x)\n", device_unit(&sc->sc_dev));
|
||||
#endif
|
||||
sc->sc_flags &= ~PARF_DELAY;
|
||||
wakeup(sc);
|
||||
|
@ -220,7 +220,7 @@ partimo(void *arg)
|
|||
|
||||
#ifdef DEBUG
|
||||
if (pardebug & PDB_FOLLOW)
|
||||
printf("partimo(%x)\n", sc->sc_dev.dv_unit);
|
||||
printf("partimo(%x)\n", device_unit(&sc->sc_dev));
|
||||
#endif
|
||||
sc->sc_flags &= ~(PARF_UIO|PARF_TIMO);
|
||||
wakeup(sc);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.28 2006/02/25 17:37:14 thorpej Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.29 2006/03/26 04:36:41 thorpej Exp $ */
|
||||
/* $OpenBSD: autoconf.c,v 1.9 1997/05/18 13:45:20 pefo Exp $ */
|
||||
|
||||
/*
|
||||
|
@ -88,7 +88,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.28 2006/02/25 17:37:14 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.29 2006/03/26 04:36:41 thorpej Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -267,8 +267,8 @@ device_register(struct device *dev, void *aux)
|
|||
}
|
||||
|
||||
if (scsiboot && device_is_a(dev, "scsibus")) {
|
||||
/* XXX dv_unit abuse */
|
||||
if (dev->dv_unit == b->bus) {
|
||||
/* XXX device_unit() abuse */
|
||||
if (device_unit(dev) == b->bus) {
|
||||
scsibusdev = dev;
|
||||
#if 0
|
||||
printf("\nscsibus = %s\n", dev->dv_xname);
|
||||
|
@ -293,8 +293,8 @@ device_register(struct device *dev, void *aux)
|
|||
}
|
||||
return;
|
||||
}
|
||||
/* XXX dv_unit abuse */
|
||||
if (dev->dv_unit == b->unit) {
|
||||
/* XXX device_unit() abuse */
|
||||
if (device_unit(dev) == b->unit) {
|
||||
booted_device = dev;
|
||||
#if 0
|
||||
printf("\nbooted_device = %s\n", dev->dv_xname);
|
||||
|
|
Loading…
Reference in New Issue