diff --git a/sys/arch/cobalt/cobalt/cpu.c b/sys/arch/cobalt/cobalt/cpu.c index 90ce662b47f9..9a8171c182de 100644 --- a/sys/arch/cobalt/cobalt/cpu.c +++ b/sys/arch/cobalt/cobalt/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.9 2006/04/05 15:07:17 tsutsui Exp $ */ +/* $NetBSD: cpu.c,v 1.10 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2006/04/05 15:07:17 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.10 2008/05/09 10:59:55 tsutsui Exp $"); #include #include @@ -38,23 +38,23 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.9 2006/04/05 15:07:17 tsutsui Exp $"); #include "ioconf.h" -int cpu_match(struct device *, struct cfdata *, void *); -void cpu_attach(struct device *, struct device *, void *); +int cpu_match(device_t, cfdata_t, void *); +void cpu_attach(device_t, device_t, void *); -CFATTACH_DECL(cpu, sizeof (struct device), +CFATTACH_DECL_NEW(cpu, 0, cpu_match, cpu_attach, NULL, NULL); int -cpu_match(struct device *parent, struct cfdata *cf, void *aux) +cpu_match(device_t parent, cfdata_t cf, void *aux) { return 1; } void -cpu_attach(struct device *parent, struct device *dev, void *aux) +cpu_attach(device_t parent, device_t self, void *aux) { - printf(": "); + aprint_normal(": "); cpu_identify(); } diff --git a/sys/arch/cobalt/cobalt/mainbus.c b/sys/arch/cobalt/cobalt/mainbus.c index b407f6dda901..55a73bbd3aed 100644 --- a/sys/arch/cobalt/cobalt/mainbus.c +++ b/sys/arch/cobalt/cobalt/mainbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: mainbus.c,v 1.17 2008/03/27 15:21:46 tsutsui Exp $ */ +/* $NetBSD: mainbus.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.17 2008/03/27 15:21:46 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $"); #include #include @@ -38,35 +38,34 @@ __KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.17 2008/03/27 15:21:46 tsutsui Exp $") #include "locators.h" -static int mainbus_match(struct device *, struct cfdata *, void *); -static void mainbus_attach(struct device *, struct device *, void *); -static int mainbus_search(struct device *, struct cfdata *, +static int mainbus_match(device_t, cfdata_t, void *); +static void mainbus_attach(device_t, device_t, void *); +static int mainbus_search(device_t, cfdata_t, const int *, void *); int mainbus_print(void *, const char *); -CFATTACH_DECL(mainbus, sizeof(struct device), +CFATTACH_DECL_NEW(mainbus, 0, mainbus_match, mainbus_attach, NULL, NULL); static int -mainbus_match(struct device *parent, struct cfdata *match, void *aux) +mainbus_match(device_t parent, cfdata_t cf, void *aux) { return 1; } static void -mainbus_attach(struct device *parent, struct device *self, void *aux) +mainbus_attach(device_t parent, device_t self, void *aux) { struct mainbus_attach_args ma; - printf("\n"); + aprint_normal("\n"); config_search_ia(mainbus_search, self, "mainbus", &ma); } static int -mainbus_search(struct device *parent, struct cfdata *cf, const int *ldesc, - void *aux) +mainbus_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { struct mainbus_attach_args *ma = aux; diff --git a/sys/arch/cobalt/dev/gt.c b/sys/arch/cobalt/dev/gt.c index d48fc22ed0cc..283ec22ca12d 100644 --- a/sys/arch/cobalt/dev/gt.c +++ b/sys/arch/cobalt/dev/gt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gt.c,v 1.20 2006/09/10 06:41:09 tsutsui Exp $ */ +/* $NetBSD: gt.c,v 1.21 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.20 2006/09/10 06:41:09 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.21 2008/05/09 10:59:55 tsutsui Exp $"); #include "opt_pci.h" #include "pci.h" @@ -62,15 +62,15 @@ __KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.20 2006/09/10 06:41:09 tsutsui Exp $"); #include struct gt_softc { - struct device sc_dev; + device_t sc_dev; bus_space_tag_t sc_bst; bus_space_handle_t sc_bsh; struct cobalt_pci_chipset sc_pc; }; -static int gt_match(struct device *, struct cfdata *, void *); -static void gt_attach(struct device *, struct device *, void *); +static int gt_match(device_t, cfdata_t, void *); +static void gt_attach(device_t, device_t, void *); static int gt_print(void *aux, const char *pnp); static void gt_timer_init(struct gt_softc *sc); @@ -79,11 +79,11 @@ static void gt_timer0_init(void *); static long gt_timer0_read(void *); #endif -CFATTACH_DECL(gt, sizeof(struct gt_softc), +CFATTACH_DECL_NEW(gt, sizeof(struct gt_softc), gt_match, gt_attach, NULL, NULL); static int -gt_match(struct device *parent, struct cfdata *match, void *aux) +gt_match(device_t parent, cfdata_t cf, void *aux) { return 1; @@ -92,23 +92,24 @@ gt_match(struct device *parent, struct cfdata *match, void *aux) #define GT_REG_REGION 0x1000 static void -gt_attach(struct device *parent, struct device *self, void *aux) +gt_attach(device_t parent, device_t self, void *aux) { + struct gt_softc *sc = device_private(self); struct mainbus_attach_args *ma = aux; - struct gt_softc *sc = (void *)self; #if NPCI > 0 pci_chipset_tag_t pc; struct pcibus_attach_args pba; #endif + sc->sc_dev = self; sc->sc_bst = ma->ma_iot; if (bus_space_map(sc->sc_bst, ma->ma_addr, GT_REG_REGION, 0, &sc->sc_bsh)) { - printf(": unable to map GT64111 registers\n"); + aprint_error(": unable to map GT64111 registers\n"); return; } - printf("\n"); + aprint_normal("\n"); gt_timer_init(sc); diff --git a/sys/arch/cobalt/dev/panel.c b/sys/arch/cobalt/dev/panel.c index 30cc6aca84be..85f2d034a469 100644 --- a/sys/arch/cobalt/dev/panel.c +++ b/sys/arch/cobalt/dev/panel.c @@ -1,4 +1,4 @@ -/* $NetBSD: panel.c,v 1.17 2008/03/22 18:32:20 tsutsui Exp $ */ +/* $NetBSD: panel.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 2002 Dennis I. Chernoivanov @@ -28,7 +28,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.17 2008/03/22 18:32:20 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.18 2008/05/09 10:59:55 tsutsui Exp $"); #include #include @@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: panel.c,v 1.17 2008/03/22 18:32:20 tsutsui Exp $"); #define PANEL_ROWS 2 struct panel_softc { - struct device sc_dev; + device_t sc_dev; struct hd44780_chip sc_lcd; struct lcdkp_chip sc_kp; @@ -81,8 +81,8 @@ static const struct lcd_message shutdown_message = { "Shutting down..." }; -static int panel_match(struct device *, struct cfdata *, void *); -static void panel_attach(struct device *, struct device *, void *); +static int panel_match(device_t, cfdata_t, void *); +static void panel_attach(device_t, device_t, void *); static void panel_shutdown(void *); static void panel_soft(void *); @@ -104,20 +104,20 @@ const struct cdevsw panel_cdevsw = { nostop, notty, panelpoll, nommap, }; -CFATTACH_DECL(panel, sizeof(struct panel_softc), +CFATTACH_DECL_NEW(panel, sizeof(struct panel_softc), panel_match, panel_attach, NULL, NULL); static int -panel_match(struct device *parent, struct cfdata *match, void *aux) +panel_match(device_t parent, cfdata_t cf, void *aux) { return 1; } static void -panel_attach(struct device *parent, struct device *self, void *aux) +panel_attach(device_t parent, device_t self, void *aux) { - struct panel_softc *sc = (void *)self; + struct panel_softc *sc = device_private(self); struct mainbus_attach_args *maa = aux; struct hd44780_io io; static struct lcdkp_xlate keys[] = { @@ -129,10 +129,11 @@ panel_attach(struct device *parent, struct device *self, void *aux) { 0xbe, 'e' } }; + sc->sc_lcd.sc_dev = self; sc->sc_lcd.sc_iot = maa->ma_iot; if (bus_space_map(sc->sc_lcd.sc_iot, maa->ma_addr, PANEL_REGION, 0, &sc->sc_lcd.sc_ioir)) { - printf(": unable to map registers\n"); + aprint_error(": unable to map registers\n"); return; } bus_space_subregion(sc->sc_lcd.sc_iot, sc->sc_lcd.sc_ioir, DATA_OFFSET, @@ -145,7 +146,6 @@ panel_attach(struct device *parent, struct device *self, void *aux) sc->sc_lcd.sc_writereg = panel_cbt_hdwritereg; sc->sc_lcd.sc_readreg = panel_cbt_hdreadreg; - sc->sc_lcd.sc_dev = self; hd44780_attach_subr(&sc->sc_lcd); @@ -224,7 +224,7 @@ panel_cbt_hdreadreg(struct hd44780_chip *hd, uint32_t en, uint32_t rs) int panelopen(dev_t dev, int flag, int mode, struct lwp *l) { - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc = device_lookup_private(&panel_cd, minor(dev)); return (sc->sc_lcd.sc_dev_ok == 0) ? ENXIO : 0; } @@ -232,7 +232,7 @@ panelopen(dev_t dev, int flag, int mode, struct lwp *l) int panelclose(dev_t dev, int flag, int mode, struct lwp *l) { - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc = device_lookup_private(&panel_cd, minor(dev)); selnotify(&sc->sc_selq, 0, 0); return 0; @@ -243,7 +243,7 @@ panelread(dev_t dev, struct uio *uio, int flag) { int error; uint8_t b; - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc = device_lookup_private(&panel_cd, minor(dev)); if (uio->uio_resid < sizeof(b)) return EIO; @@ -259,7 +259,7 @@ panelwrite(dev_t dev, struct uio *uio, int flag) { int error; struct hd44780_io io; - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc = device_lookup_private(&panel_cd, minor(dev)); io.dat = 0; io.len = uio->uio_resid; @@ -276,7 +276,7 @@ panelwrite(dev_t dev, struct uio *uio, int flag) int panelioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) { - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc = device_lookup_private(&panel_cd, minor(dev)); return hd44780_ioctl_subr(&sc->sc_lcd, cmd, data); } @@ -287,8 +287,9 @@ panelpoll(dev_t dev, int events, struct lwp *l) int revents = 0; if ((events & (POLLIN | POLLRDNORM)) != 0) { - struct panel_softc *sc = device_lookup(&panel_cd, minor(dev)); + struct panel_softc *sc; + sc = device_lookup_private(&panel_cd, minor(dev)); if (lcdkp_scankey(&sc->sc_kp) != 0) { revents = events & (POLLIN | POLLRDNORM); } else { diff --git a/sys/arch/cobalt/pci/pchb.c b/sys/arch/cobalt/pci/pchb.c index 18d465ce4634..74829f0f7dec 100644 --- a/sys/arch/cobalt/pci/pchb.c +++ b/sys/arch/cobalt/pci/pchb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pchb.c,v 1.9 2006/08/22 21:42:19 riz Exp $ */ +/* $NetBSD: pchb.c,v 1.10 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.9 2006/08/22 21:42:19 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.10 2008/05/09 10:59:55 tsutsui Exp $"); #include #include @@ -40,14 +40,14 @@ __KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.9 2006/08/22 21:42:19 riz Exp $"); #include -static int pchb_match(struct device *, struct cfdata *, void *); -static void pchb_attach(struct device *, struct device *, void *); +static int pchb_match(device_t, cfdata_t, void *); +static void pchb_attach(device_t, device_t, void *); -CFATTACH_DECL(pchb, sizeof(struct device), +CFATTACH_DECL_NEW(pchb, 0, pchb_match, pchb_attach, NULL, NULL); static int -pchb_match(struct device *parent, struct cfdata *match, void *aux) +pchb_match(device_t parent, cfdata_t cf, void *aux) { struct pci_attach_args *pa = aux; @@ -59,7 +59,7 @@ pchb_match(struct device *parent, struct cfdata *match, void *aux) } static void -pchb_attach(struct device *parent, struct device *self, void *aux) +pchb_attach(device_t parent, device_t self, void *aux) { struct pci_attach_args *pa = aux; int major, minor; @@ -68,7 +68,9 @@ pchb_attach(struct device *parent, struct device *self, void *aux) minor = PCI_REVISION(pa->pa_class) & 0x0f; if (major == 0) - printf(": Galileo GT-64011 System Controller, rev %d\n", minor); + aprint_normal(": Galileo GT-64011 System Controller, rev %d\n", + minor); else - printf(": Galileo GT-64111 System Controller, rev %d\n", minor); + aprint_normal(": Galileo GT-64111 System Controller, rev %d\n", + minor); } diff --git a/sys/arch/cobalt/pci/pcib.c b/sys/arch/cobalt/pci/pcib.c index 776a137ba8bb..b9efa5f9d07e 100644 --- a/sys/arch/cobalt/pci/pcib.c +++ b/sys/arch/cobalt/pci/pcib.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcib.c,v 1.18 2006/05/31 12:59:39 tsutsui Exp $ */ +/* $NetBSD: pcib.c,v 1.19 2008/05/09 10:59:55 tsutsui Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang. All rights reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.18 2006/05/31 12:59:39 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.19 2008/05/09 10:59:55 tsutsui Exp $"); #include #include @@ -42,14 +42,14 @@ __KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.18 2006/05/31 12:59:39 tsutsui Exp $"); #include #include -static int pcib_match(struct device *, struct cfdata *, void *); -static void pcib_attach(struct device *, struct device *, void *); +static int pcib_match(device_t, cfdata_t, void *); +static void pcib_attach(device_t, device_t, void *); -CFATTACH_DECL(pcib, sizeof(struct device), +CFATTACH_DECL_NEW(pcib, 0, pcib_match, pcib_attach, NULL, NULL); static int -pcib_match(struct device *parent, struct cfdata *match, void *aux) +pcib_match(device_t parent, cfdata_t cf, void *aux) { struct pci_attach_args *pa = aux; @@ -61,13 +61,14 @@ pcib_match(struct device *parent, struct cfdata *match, void *aux) } static void -pcib_attach(struct device *parent, struct device *self, void *aux) +pcib_attach(device_t parent, device_t self, void *aux) { struct pci_attach_args *pa = aux; char devinfo[256]; + aprint_normal("\n"); pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); - printf("\n%s: %s, rev %d\n", self->dv_xname, devinfo, + aprint_normal_dev(self, "%s, rev %d\n", devinfo, PCI_REVISION(pa->pa_class)); }