Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Get the pointer to the driver name early, rather th...
details: https://anonhg.NetBSD.org/src/rev/96a187837a23
branches: trunk
changeset: 537101:96a187837a23
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu Sep 26 20:45:42 2002 +0000
description:
Get the pointer to the driver name early, rather than constantly
deferencing the cfdriver pointer.
diffstat:
sys/arch/pmax/pmax/autoconf.c | 20 ++++++++++----------
sys/arch/sgimips/sgimips/autoconf.c | 14 +++++++-------
2 files changed, 17 insertions(+), 17 deletions(-)
diffs (125 lines):
diff -r 97b0a9a09490 -r 96a187837a23 sys/arch/pmax/pmax/autoconf.c
--- a/sys/arch/pmax/pmax/autoconf.c Thu Sep 26 20:42:10 2002 +0000
+++ b/sys/arch/pmax/pmax/autoconf.c Thu Sep 26 20:45:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.61 2001/08/27 02:00:17 nisimura Exp $ */
+/* $NetBSD: autoconf.c,v 1.62 2002/09/26 20:45:42 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -43,7 +43,7 @@
*/
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.61 2001/08/27 02:00:17 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.62 2002/09/26 20:45:42 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -172,7 +172,7 @@
static struct device *ioasicdev;
struct device *parent = dev->dv_parent;
struct cfdata *cf = dev->dv_cfdata;
- struct cfdriver *cd = cf->cf_driver;
+ const char *name = cf->cf_driver->cd_name;
if (found)
return;
@@ -187,7 +187,7 @@
/*
* Check if IOASIC was the boot slot.
*/
- if (strcmp(cd->cd_name, "ioasic") == 0) {
+ if (strcmp(name, "ioasic") == 0) {
struct tc_attach_args *ta = aux;
if (ta->ta_slot == booted_slot)
@@ -198,7 +198,7 @@
/*
* Check for ASC controller on either IOASIC or TC option card.
*/
- if (scsiboot && strcmp(cd->cd_name, "asc") == 0) {
+ if (scsiboot && strcmp(name, "asc") == 0) {
struct tc_attach_args *ta = aux;
/*
@@ -218,7 +218,7 @@
* If an SII device is configured, it's currently the only
* possible SCSI boot device.
*/
- if (scsiboot && strcmp(cd->cd_name, "sii") == 0) {
+ if (scsiboot && strcmp(name, "sii") == 0) {
booted_controller = dev;
return;
}
@@ -227,9 +227,9 @@
* If we found the boot controller, if check disk/tape/cdrom device
* on that controller matches.
*/
- if (booted_controller && (strcmp(cd->cd_name, "sd") == 0 ||
- strcmp(cd->cd_name, "st") == 0 ||
- strcmp(cd->cd_name, "cd") == 0)) {
+ if (booted_controller && (strcmp(name, "sd") == 0 ||
+ strcmp(name, "st") == 0 ||
+ strcmp(name, "cd") == 0)) {
struct scsipibus_attach_args *sa = aux;
if (parent->dv_parent != booted_controller)
@@ -244,7 +244,7 @@
/*
* Check if netboot device.
*/
- if (netboot && strcmp(cd->cd_name, "le") == 0) {
+ if (netboot && strcmp(name, "le") == 0) {
struct tc_attach_args *ta = aux;
#if defined(DEC_3100) || defined(DEC_5100)
diff -r 97b0a9a09490 -r 96a187837a23 sys/arch/sgimips/sgimips/autoconf.c
--- a/sys/arch/sgimips/sgimips/autoconf.c Thu Sep 26 20:42:10 2002 +0000
+++ b/sys/arch/sgimips/sgimips/autoconf.c Thu Sep 26 20:45:42 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.9 2002/07/15 04:38:59 rafal Exp $ */
+/* $NetBSD: autoconf.c,v 1.10 2002/09/26 20:47:50 thorpej Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@@ -162,7 +162,7 @@
static int found, initted, scsiboot, netboot;
struct device *parent = dev->dv_parent;
struct cfdata *cf = dev->dv_cfdata;
- struct cfdriver *cd = cf->cf_driver;
+ const char *name = cf->cf_driver->cd_name;
if (found)
return;
@@ -176,7 +176,7 @@
/*
* Check for WDC controller
*/
- if (scsiboot && strcmp(cd->cd_name, "wdsc") == 0) {
+ if (scsiboot && strcmp(name, "wdsc") == 0) {
/*
* XXX: this fails if the controllers were attached
* in an order other than the ARCS-imposed order.
@@ -194,9 +194,9 @@
* If we found the boot controller, if check disk/tape/cdrom device
* on that controller matches.
*/
- if (booted_controller && (strcmp(cd->cd_name, "sd") == 0 ||
- strcmp(cd->cd_name, "st") == 0 ||
- strcmp(cd->cd_name, "cd") == 0)) {
+ if (booted_controller && (strcmp(name, "sd") == 0 ||
+ strcmp(name, "st") == 0 ||
+ strcmp(name, "cd") == 0)) {
struct scsipibus_attach_args *sa = aux;
if (parent->dv_parent != booted_controller)
@@ -211,7 +211,7 @@
/*
* Check if netboot device.
*/
- if (netboot && strcmp(cd->cd_name, "sq") == 0) {
+ if (netboot && strcmp(name, "sq") == 0) {
/* XXX Check unit number? (Which we don't parse yet) */
booted_device = dev;
found = 1;
Home |
Main Index |
Thread Index |
Old Index