Use device_unit() (and remove a couple of places where it is not

needed).
This commit is contained in:
thorpej 2006-03-26 04:38:52 +00:00
parent 21374641a5
commit 5a75140fb8
3 changed files with 9 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: epcom.c,v 1.8 2006/03/08 10:48:40 he Exp $ */
/* $NetBSD: epcom.c,v 1.9 2006/03/26 04:38:52 thorpej Exp $ */
/*
* Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
* All rights reserved.
@ -80,7 +80,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.8 2006/03/08 10:48:40 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.9 2006/03/26 04:38:52 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -236,7 +236,7 @@ epcom_attach_subr(struct epcom_softc *sc)
/* locate the major number */
maj = cdevsw_lookup_major(&epcom_cdevsw);
cn_tab->cn_dev = makedev(maj, sc->sc_dev.dv_unit);
cn_tab->cn_dev = makedev(maj, device_unit(&sc->sc_dev));
aprint_normal("%s: console\n", sc->sc_dev.dv_xname);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: epled.c,v 1.1 2005/11/12 05:33:23 hamajima Exp $ */
/* $NetBSD: epled.c,v 1.2 2006/03/26 04:38:52 thorpej Exp $ */
/*
* Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epled.c,v 1.1 2005/11/12 05:33:23 hamajima Exp $");
__KERNEL_RCSID(0, "$NetBSD: epled.c,v 1.2 2006/03/26 04:38:52 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -74,8 +74,7 @@ epled_attach(struct device *parent, struct device *self, void *aux)
the_epled_sc = sc;
#ifdef DIAGNOSTIC
else
printf("%s%d is already configured\n",
sc->sc_dev.dv_xname, sc->sc_dev.dv_unit);
printf("%s is already configured\n", sc->sc_dev.dv_xname);
#endif
epgpio_out(sc->sc_gpio, sc->sc_port, sc->sc_green);

View File

@ -1,4 +1,4 @@
/* $NetBSD: epwdog.c,v 1.1 2005/11/12 05:33:23 hamajima Exp $ */
/* $NetBSD: epwdog.c,v 1.2 2006/03/26 04:38:52 thorpej Exp $ */
/*
* Copyright (c) 2005 HAMAJIMA Katsuomi. All rights reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: epwdog.c,v 1.1 2005/11/12 05:33:23 hamajima Exp $");
__KERNEL_RCSID(0, "$NetBSD: epwdog.c,v 1.2 2006/03/26 04:38:52 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -77,10 +77,7 @@ epwdog_attach(struct device *parent, struct device *self, void *aux)
the_epwdog_sc = sc;
#ifdef DIAGNOSTIC
else
printf("%s%d is already configured\n",
sc->sc_dev.dv_xname, sc->sc_dev.dv_unit);
#endif
}
printf("%s is already configured\n", sc->sc_dev.dv_xname);
int
epwdog_reset(void)