use aprint_*_dev and device_xname

OK joerg
This commit is contained in:
cegger 2008-04-04 22:05:39 +00:00
parent 3bbc95f39d
commit 320e553f24
8 changed files with 61 additions and 70 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: vesabios.c,v 1.24 2007/03/24 00:07:17 reinoud Exp $ */
/* $NetBSD: vesabios.c,v 1.25 2008/04/04 22:05:39 cegger Exp $ */
/*
* Copyright (c) 2002, 2004
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vesabios.c,v 1.24 2007/03/24 00:07:17 reinoud Exp $");
__KERNEL_RCSID(0, "$NetBSD: vesabios.c,v 1.25 2008/04/04 22:05:39 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -220,8 +220,7 @@ vesabios_attach(struct device *parent, struct device *dev,
buf = kvm86_bios_addpage(0x2000);
if (!buf) {
aprint_error("%s: kvm86_bios_addpage(0x2000) failed\n",
dev->dv_xname);
aprint_error_dev(dev, "kvm86_bios_addpage(0x2000) failed\n");
return;
}
for (i = 0; i < nmodes; i++) {
@ -234,16 +233,16 @@ vesabios_attach(struct device *parent, struct device *dev,
res = kvm86_bioscall(0x10, &tf);
if (res || (tf.tf_eax & 0xff) != 0x4f) {
aprint_error("%s: vbecall: res=%d, ax=%x\n",
dev->dv_xname, res, tf.tf_eax);
aprint_error("%s: error getting info for mode %04x\n",
dev->dv_xname, modes[i]);
aprint_error_dev(dev, "vbecall: res=%d, ax=%x\n",
res, tf.tf_eax);
aprint_error_dev(dev, "error getting info for mode %04x\n",
modes[i]);
continue;
}
mi = (struct modeinfoblock *)buf;
#ifdef VESABIOSVERBOSE
aprint_verbose("%s: VESA mode %04x: attributes %04x",
dev->dv_xname, modes[i], mi->ModeAttributes);
aprint_verbose_dev(dev, "VESA mode %04x: attributes %04x",
modes[i], mi->ModeAttributes);
#endif
if (!(mi->ModeAttributes & 1)) {
#ifdef VESABIOSVERBOSE
@ -262,9 +261,8 @@ vesabios_attach(struct device *parent, struct device *dev,
/* flat buffer */
rastermodes[nrastermodes++] = modes[i];
#ifdef VESABIOSVERBOSE
aprint_verbose("%s: memory window "
aprint_verbose_dev(dev, "memory window "
"granularity %d Kb, window size %d Kb\n",
dev->dv_xname,
mi->WinGranularity/1024, mi->WinSize/1024);
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vesafb.c,v 1.25 2007/12/09 20:27:45 jmcneill Exp $ */
/* $NetBSD: vesafb.c,v 1.26 2008/04/04 22:05:39 cegger Exp $ */
/*-
* Copyright (c) 2006 Jared D. McNeill <jmcneill@invisible.ca>
@ -37,7 +37,7 @@
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vesafb.c,v 1.25 2007/12/09 20:27:45 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: vesafb.c,v 1.26 2008/04/04 22:05:39 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -154,8 +154,7 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
buf = kvm86_bios_addpage(0x2000);
if (!buf) {
aprint_error("%s: kvm86_bios_addpage(0x2000) failed\n",
sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "kvm86_bios_addpage(0x2000) failed\n");
return;
}
sc->sc_buf = buf;
@ -182,8 +181,8 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
res = kvm86_bioscall(0x10, &tf);
if (res || (tf.tf_eax & 0xff) != 0x4f) {
aprint_error("%s: vbecall: res=%d, ax=%x\n",
sc->sc_dev.dv_xname, res, tf.tf_eax);
aprint_error_dev(&sc->sc_dev, "vbecall: res=%d, ax=%x\n",
res, tf.tf_eax);
goto out;
}
mi = (struct modeinfoblock *)buf;
@ -197,8 +196,7 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
}
if (i == vaa->vbaa_nmodes) {
aprint_error("%s: no supported mode found\n",
sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "no supported mode found\n");
goto out;
}
@ -227,7 +225,7 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
sc->sc_vd.init_screen = vesafb_init_screen;
sc->sc_vd.show_screen_cb = vesafb_show_screen_cb;
aprint_normal("%s: fb %dx%dx%d @0x%x\n", sc->sc_dev.dv_xname,
aprint_normal_dev(&sc->sc_dev, "fb %dx%dx%d @0x%x\n",
mi->XResolution, mi->YResolution,
mi->BitsPerPixel, mi->PhysBasePtr);
@ -245,17 +243,16 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
sc->sc_screensize = mi->YResolution * mi->BytesPerScanLine;
sc->sc_fbsize = sc->sc_scrollscreens * sc->sc_screensize;
aprint_normal("%s: %d Kb memory reported, %d screens possible\n",
sc->sc_dev.dv_xname,
aprint_normal_dev(&sc->sc_dev, "%d Kb memory reported, %d screens possible\n",
sc->sc_fbsize / 1024,
sc->sc_scrollscreens);
if (sc->sc_scrollscreens == 1)
aprint_normal("%s: one screen, so hardware scrolling not "
"possible\n", sc->sc_dev.dv_xname);
aprint_normal_dev(&sc->sc_dev, "one screen, so hardware scrolling not "
"possible\n");
if (sc->sc_pm) {
aprint_normal("%s: VBE/PM %d.%d\n", sc->sc_dev.dv_xname,
aprint_normal_dev(&sc->sc_dev, "VBE/PM %d.%d\n",
(sc->sc_pmver >> 4), sc->sc_pmver & 0xf);
}
@ -264,8 +261,7 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_PREFETCHABLE,
&h);
if (res) {
aprint_error("%s: framebuffer mapping failed\n",
sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "framebuffer mapping failed\n");
goto out;
}
sc->sc_fbstart = bus_space_vaddr(X86_BUS_SPACE_MEM, h);
@ -275,8 +271,8 @@ vesafb_attach(struct device *parent, struct device *dev, void *aux)
sc->sc_shadowbits = malloc(sc->sc_screensize,
M_VESAFB, M_NOWAIT);
if (sc->sc_shadowbits == NULL) {
aprint_error("%s: unable to allocate %d bytes for shadowfb\n",
sc->sc_dev.dv_xname, sc->sc_screensize);
aprint_error_dev(&sc->sc_dev, "unable to allocate %d bytes for shadowfb\n",
sc->sc_screensize);
/* Not fatal; we'll just have to continue without shadowfb */
}
#endif
@ -568,8 +564,8 @@ vv_copyrows(void *id, int srcrow, int dstrow, int nrows)
res = kvm86_bioscall(0x10, &tf);
if (res || (tf.tf_eax & 0xff) != 0x4f) {
working = 0;
aprint_error("%s: vbecall: res=%d, ax=%x\n",
sc->sc_dev.dv_xname, res, tf.tf_eax);
aprint_error_dev(&sc->sc_dev, "vbecall: res=%d, ax=%x\n",
res, tf.tf_eax);
hwbits = cur_hwbits;
goto out;
}
@ -659,8 +655,7 @@ vesafb_init(struct vesafb_softc *sc, int setmode)
regs.EBX = sc->sc_mode | 0x4000;
kvm86_bioscall_simple(0x10, &regs);
if ((regs.EAX & 0xff) != 0x4f) {
aprint_error("%s: bioscall failed\n",
sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "bioscall failed\n");
goto out;
}
}
@ -673,8 +668,8 @@ vesafb_init(struct vesafb_softc *sc, int setmode)
kvm86_bioscall_simple(0x10, &regs);
if ((regs.EAX & 0xff) != 0x4f) {
aprint_error("%s: vbecall failed: ax=%x\n",
sc->sc_dev.dv_xname, regs.EAX);
aprint_error_dev(&sc->sc_dev, "vbecall failed: ax=%x\n",
regs.EAX);
goto out;
}
@ -795,8 +790,8 @@ vesafb_set_palette(struct vesafb_softc *sc, int reg,
res = kvm86_bioscall(0x10, &tf);
if (res || (tf.tf_eax & 0xff) != 0x4f)
aprint_error("%s: vbecall: res=%d, ax=%x\n",
sc->sc_dev.dv_xname, res, tf.tf_eax);
aprint_error_dev(&sc->sc_dev, "vbecall: res=%d, ax=%x\n",
res, tf.tf_eax);
return;
}
@ -840,8 +835,8 @@ vesafb_gvideo(struct vesafb_softc *sc, u_int *on)
res = kvm86_bioscall(0x10, &tf);
if (res || (tf.tf_eax & 0xff) != 0x4f) {
aprint_error("%s: unable to get power state (0x%04x)\n",
sc->sc_dev.dv_xname, (tf.tf_eax & 0xffff));
aprint_error_dev(&sc->sc_dev, "unable to get power state (0x%04x)\n",
(tf.tf_eax & 0xffff));
return ENODEV;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: identcpu.c,v 1.88 2008/02/26 18:24:28 xtraeme Exp $ */
/* $NetBSD: identcpu.c,v 1.89 2008/04/04 22:07:22 cegger Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2006, 2007 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.88 2008/02/26 18:24:28 xtraeme Exp $");
__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.89 2008/04/04 22:07:22 cegger Exp $");
#include "opt_enhanced_speedstep.h"
#include "opt_intel_odcm.h"
@ -1107,8 +1107,7 @@ transmeta_cpu_info(struct cpu_info *ci)
nreg = descs[0];
if (nreg >= 0x80860001) {
x86_cpuid(0x80860001, descs);
aprint_verbose("%s: Processor revision %u.%u.%u.%u\n",
ci->ci_dev->dv_xname,
aprint_verbose_dev(ci->ci_dev, "Processor revision %u.%u.%u.%u\n",
(descs[1] >> 24) & 0xff,
(descs[1] >> 16) & 0xff,
(descs[1] >> 8) & 0xff,
@ -1116,8 +1115,8 @@ transmeta_cpu_info(struct cpu_info *ci)
}
if (nreg >= 0x80860002) {
x86_cpuid(0x80860002, descs);
aprint_verbose("%s: Code Morphing Software Rev: %u.%u.%u-%u-%u\n",
ci->ci_dev->dv_xname, (descs[1] >> 24) & 0xff,
aprint_verbose_dev(ci->ci_dev, "Code Morphing Software Rev: %u.%u.%u-%u-%u\n",
(descs[1] >> 24) & 0xff,
(descs[1] >> 16) & 0xff,
(descs[1] >> 8) & 0xff,
descs[1] & 0xff,
@ -1134,15 +1133,14 @@ transmeta_cpu_info(struct cpu_info *ci)
x86_cpuid(0x80860003 + i, info.descs[i]);
}
info.text[64] = '\0';
aprint_verbose("%s: %s\n", ci->ci_dev->dv_xname, info.text);
aprint_verbose_dev(ci->ci_dev, "%s\n", info.text);
}
if (nreg >= 0x80860007) {
longrun = tmx86_get_longrun_mode();
tmx86_get_longrun_status(&frequency,
&voltage, &percentage);
aprint_verbose("%s: LongRun mode: %d <%dMHz %dmV %d%%>\n",
ci->ci_dev->dv_xname,
aprint_verbose_dev(ci->ci_dev, "LongRun mode: %d <%dMHz %dmV %d%%>\n",
longrun, frequency, voltage, percentage);
}
}
@ -1165,7 +1163,7 @@ identifycpu(struct cpu_info *ci)
int modif, family, model;
const struct cpu_cpuid_nameclass *cpup = NULL;
const struct cpu_cpuid_family *cpufam;
char *cpuname = ci->ci_dev->dv_xname;
const char *cpuname = device_xname(ci->ci_dev);
char *buf;
const char *feature_str[3];

View File

@ -1,4 +1,4 @@
/* $NetBSD: mtrr_k6.c,v 1.12 2007/10/17 19:54:46 garbled Exp $ */
/* $NetBSD: mtrr_k6.c,v 1.13 2008/04/04 22:07:22 cegger Exp $ */
/*
* Copyright 2001 Wasabi Systems, Inc.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mtrr_k6.c,v 1.12 2007/10/17 19:54:46 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: mtrr_k6.c,v 1.13 2008/04/04 22:07:22 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -216,7 +216,7 @@ k6_mtrr_init_cpu(struct cpu_info *ci)
k6_mtrr_reload();
#if 0
mtrr_dump(ci->ci_dev->dv_xname);
mtrr_dump(device_xname(ci->ci_dev));
#endif
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: powernow_k7.c,v 1.28 2007/10/17 19:54:46 garbled Exp $ */
/* $NetBSD: powernow_k7.c,v 1.29 2008/04/04 22:07:22 cegger Exp $ */
/* $OpenBSD: powernow-k7.c,v 1.24 2006/06/16 05:58:50 gwk Exp $ */
/*-
@ -66,7 +66,7 @@
/* AMD POWERNOW K7 driver */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: powernow_k7.c,v 1.28 2007/10/17 19:54:46 garbled Exp $");
__KERNEL_RCSID(0, "$NetBSD: powernow_k7.c,v 1.29 2008/04/04 22:07:22 cegger Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -353,7 +353,7 @@ k7_powernow_init(void)
const struct sysctlnode *freqnode, *node, *pnownode;
struct powernow_cpu_state *cstate;
struct cpu_info *ci;
char *cpuname;
const char *cpuname;
const char *techname;
size_t len;
int i;
@ -361,7 +361,7 @@ k7_powernow_init(void)
ci = curcpu();
freq_names_len = 0;
cpuname = ci->ci_dev->dv_xname;
cpuname = device_xname(ci->ci_dev);
k7pnow_current_state = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ahc_isa.c,v 1.33 2007/03/07 21:44:10 thorpej Exp $ */
/* $NetBSD: ahc_isa.c,v 1.34 2008/04/04 22:11:06 cegger Exp $ */
/*
* Product specific probe and attach routines for:
@ -117,7 +117,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.33 2007/03/07 21:44:10 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: ahc_isa.c,v 1.34 2008/04/04 22:11:06 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -409,7 +409,7 @@ ahc_isa_attach(struct device *parent, struct device *self, void *aux)
*/
ahc->sc_dmaflags = ISABUS_DMA_32BIT;
ahc_set_name(ahc, ahc->sc_dev.dv_xname);
ahc_set_name(ahc, device_xname(&ahc->sc_dev));
ahc->parent_dmat = ia->ia_dmat;
ahc->channel = 'A';
ahc->chip = AHC_AIC7770|AHC_VL;
@ -439,8 +439,8 @@ ahc_isa_attach(struct device *parent, struct device *self, void *aux)
ahc->ih = isa_intr_establish(ia->ia_ic, irq,
intrtype, IPL_BIO, ahc_intr, ahc);
if (ahc->ih == NULL) {
aprint_error("%s: couldn't establish %s interrupt\n",
ahc->sc_dev.dv_xname, intrtypestr);
aprint_error_dev(&ahc->sc_dev, "couldn't establish %s interrupt\n",
intrtypestr);
goto free_io;
}
@ -449,8 +449,8 @@ ahc_isa_attach(struct device *parent, struct device *self, void *aux)
* usefull for debugging irq problems
*/
if (bootverbose) {
aprint_verbose("%s: Using %s interrupts\n",
ahc->sc_dev.dv_xname, intrtypestr);
aprint_verbose_dev(&ahc->sc_dev, "Using %s interrupts\n",
intrtypestr);
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: lms.c,v 1.52 2007/03/04 05:59:58 christos Exp $ */
/* $NetBSD: lms.c,v 1.53 2008/04/04 22:11:06 cegger Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles M. Hannum.
@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lms.c,v 1.52 2007/03/04 05:59:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: lms.c,v 1.53 2008/04/04 22:11:06 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -147,7 +147,7 @@ lmsattach(struct device *parent, struct device *self, void *aux)
aprint_normal(": Logitech Mouse\n");
if (bus_space_map(iot, ia->ia_io[0].ir_addr, LMS_NPORTS, 0, &ioh)) {
aprint_error("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "can't map i/o space\n");
return;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: mms.c,v 1.49 2007/03/04 05:59:58 christos Exp $ */
/* $NetBSD: mms.c,v 1.50 2008/04/04 22:11:06 cegger Exp $ */
/*-
* Copyright (c) 1993, 1994 Charles M. Hannum.
@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mms.c,v 1.49 2007/03/04 05:59:58 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: mms.c,v 1.50 2008/04/04 22:11:06 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -138,7 +138,7 @@ mmsattach(struct device *parent, struct device *self, void *aux)
aprint_normal(": Microsoft Mouse\n");
if (bus_space_map(iot, ia->ia_io[0].ir_addr, MMS_NPORTS, 0, &ioh)) {
aprint_error("%s: can't map i/o space\n", sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "can't map i/o space\n");
return;
}