Use device_is_a().

This commit is contained in:
thorpej 2006-02-27 02:59:24 +00:00
parent cbb0407210
commit d1f18238ca
4 changed files with 12 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: urlphy.c,v 1.12 2006/02/20 16:50:37 thorpej Exp $ */
/* $NetBSD: urlphy.c,v 1.13 2006/02/27 02:59:24 thorpej Exp $ */
/*
* Copyright (c) 2001, 2002
* Shingo WATANABE <nabe@nabechan.org>. All rights reserved.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.12 2006/02/20 16:50:37 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.13 2006/02/27 02:59:24 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,7 +87,7 @@ urlphy_match(struct device *parent, struct cfdata *match, void *aux)
/*
* Make sure the parent is an 'url' device.
*/
if (strcmp(parent->dv_cfdata->cf_name, "url") != 0)
if (device_is_a(parent, "url") != 0)
return(0);
return (10);

View File

@ -1,4 +1,4 @@
/* $NetBSD: uda.c,v 1.53 2005/12/11 12:23:29 christos Exp $ */
/* $NetBSD: uda.c,v 1.54 2006/02/27 03:00:33 thorpej Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -76,7 +76,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.53 2005/12/11 12:23:29 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: uda.c,v 1.54 2006/02/27 03:00:33 thorpej Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -245,8 +245,7 @@ udaattach(struct device *parent, struct device *self, void *aux)
* ctlr type it is, we check what is generated and later
* set the correct vcid.
*/
ma.ma_type = (strcmp(self->dv_cfdata->cf_name, "mtc") ?
MSCPBUS_DISK : MSCPBUS_TAPE);
ma.ma_type = (device_is_a(self, "mtc") ? MSCPBUS_TAPE : MSCPBUS_DISK);
ma.ma_mc = &uda_mscp_ctlr;
ma.ma_type |= MSCPBUS_UDA;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dma_sbus.c,v 1.26 2005/12/11 12:23:44 christos Exp $ */
/* $NetBSD: dma_sbus.c,v 1.27 2006/02/27 03:02:47 thorpej Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.26 2005/12/11 12:23:44 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.27 2006/02/27 03:02:47 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -184,7 +184,7 @@ dmaattach_sbus(parent, self, aux)
sc->sc_burst = (burst & SBUS_BURST_32) ? 32 :
(burst & SBUS_BURST_16) ? 16 : 0;
if (strcmp(sc->sc_dev.dv_cfdata->cf_name, "ledma") == 0) {
if (device_is_a(&sc->sc_dev, "ledma") == 0) {
char *cabletype;
u_int32_t csr;
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_subr.c,v 1.124 2006/02/21 04:32:39 thorpej Exp $ */
/* $NetBSD: kern_subr.c,v 1.125 2006/02/27 03:04:28 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
@ -86,7 +86,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.124 2006/02/21 04:32:39 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.125 2006/02/27 03:04:28 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@ -751,8 +751,7 @@ int booted_partition;
*/
#define DEV_USES_PARTITIONS(dv) \
(device_class((dv)) == DV_DISK && \
((dv)->dv_cfdata == NULL || \
strcmp((dv)->dv_cfdata->cf_name, "dk") != 0))
!device_is_a((dv), "dk"))
void
setroot(struct device *bootdv, int bootpartition)