Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev finish device_t-ification
details: https://anonhg.NetBSD.org/src/rev/25e86d84a665
branches: trunk
changeset: 757957:25e86d84a665
user: macallan <macallan%NetBSD.org@localhost>
date: Thu Oct 07 07:53:53 2010 +0000
description:
finish device_t-ification
diffstat:
sys/dev/pci/genfb_pci.c | 9 +++++----
sys/dev/sbus/genfb_sbus.c | 7 ++++---
sys/dev/wsfb/genfb.c | 20 ++++++++++----------
sys/dev/wsfb/genfbvar.h | 6 +++---
4 files changed, 22 insertions(+), 20 deletions(-)
diffs (185 lines):
diff -r 345184eb3373 -r 25e86d84a665 sys/dev/pci/genfb_pci.c
--- a/sys/dev/pci/genfb_pci.c Thu Oct 07 03:15:49 2010 +0000
+++ b/sys/dev/pci/genfb_pci.c Thu Oct 07 07:53:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_pci.c,v 1.24 2010/02/25 21:09:00 macallan Exp $ */
+/* $NetBSD: genfb_pci.c,v 1.25 2010/10/07 07:53:54 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.24 2010/02/25 21:09:00 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.25 2010/10/07 07:53:54 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,7 +66,7 @@
static int pci_genfb_borrow(void *, bus_addr_t, bus_space_handle_t *);
static int pci_genfb_drm_print(void *, const char *);
-CFATTACH_DECL(genfb_pci, sizeof(struct pci_genfb_softc),
+CFATTACH_DECL_NEW(genfb_pci, sizeof(struct pci_genfb_softc),
pci_genfb_match, pci_genfb_attach, NULL, NULL);
static int
@@ -105,6 +105,7 @@
aprint_naive("\n");
aprint_normal(": %s\n", devinfo);
+ sc->sc_gen.sc_dev = self;
sc->sc_memt = pa->pa_memt;
sc->sc_iot = pa->pa_iot;
sc->sc_pc = pa->pa_pc;
@@ -244,7 +245,7 @@
*/
if (kauth_authorize_generic(kauth_cred_get(), KAUTH_GENERIC_ISSUSER,
NULL) != 0) {
- aprint_normal_dev(&sc->sc_gen.sc_dev, "mmap() rejected.\n");
+ aprint_normal_dev(sc->sc_gen.sc_dev, "mmap() rejected.\n");
return -1;
}
diff -r 345184eb3373 -r 25e86d84a665 sys/dev/sbus/genfb_sbus.c
--- a/sys/dev/sbus/genfb_sbus.c Thu Oct 07 03:15:49 2010 +0000
+++ b/sys/dev/sbus/genfb_sbus.c Thu Oct 07 07:53:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_sbus.c,v 1.9 2009/09/18 12:23:16 tsutsui Exp $ */
+/* $NetBSD: genfb_sbus.c,v 1.10 2010/10/07 07:53:54 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -29,7 +29,7 @@
/* an SBus frontend for the generic fb console driver */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_sbus.c,v 1.9 2009/09/18 12:23:16 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_sbus.c,v 1.10 2010/10/07 07:53:54 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -62,7 +62,7 @@
struct lwp*);
static paddr_t genfb_mmap_sbus(void *, void *, off_t, int);
-CFATTACH_DECL(genfb_sbus, sizeof(struct genfb_sbus_softc),
+CFATTACH_DECL_NEW(genfb_sbus, sizeof(struct genfb_sbus_softc),
genfb_match_sbus, genfb_attach_sbus, NULL, NULL);
/*
@@ -100,6 +100,7 @@
int isconsole;
aprint_normal("\n");
+ sc->sc_gen.sc_dev = self;
/* Remember cookies for genfb_mmap_sbus() */
sc->sc_tag = sa->sa_bustag;
sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset);
diff -r 345184eb3373 -r 25e86d84a665 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c Thu Oct 07 03:15:49 2010 +0000
+++ b/sys/dev/wsfb/genfb.c Thu Oct 07 07:53:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb.c,v 1.31 2010/10/06 02:24:35 macallan Exp $ */
+/* $NetBSD: genfb.c,v 1.32 2010/10/07 07:53:53 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.31 2010/10/06 02:24:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.32 2010/10/07 07:53:53 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -106,7 +106,7 @@
uint32_t fboffset;
bool console;
- dict = device_properties(&sc->sc_dev);
+ dict = device_properties(sc->sc_dev);
#ifdef GENFB_DEBUG
printf(prop_dictionary_externalize(dict));
#endif
@@ -165,16 +165,16 @@
if (bl_cb != 0) {
sc->sc_backlight = (void *)(vaddr_t)bl_cb;
sc->sc_backlight_on = 1;
- aprint_naive_dev(&sc->sc_dev,
+ aprint_naive_dev(sc->sc_dev,
"enabling backlight control\n");
sc->sc_backlight_level =
sc->sc_backlight->gpc_get_parameter(
sc->sc_backlight->gpc_cookie);
if (console) {
- pmf_event_register(&sc->sc_dev,
+ pmf_event_register(sc->sc_dev,
PMFE_DISPLAY_BRIGHTNESS_UP,
genfb_brightness_up, TRUE);
- pmf_event_register(&sc->sc_dev,
+ pmf_event_register(sc->sc_dev,
PMFE_DISPLAY_BRIGHTNESS_DOWN,
genfb_brightness_down, TRUE);
}
@@ -193,7 +193,7 @@
int i, j;
bool console;
- dict = device_properties(&sc->sc_dev);
+ dict = device_properties(sc->sc_dev);
prop_dictionary_get_bool(dict, "is_console", &console);
if (prop_dictionary_get_uint16(dict, "cursor-row", &crow) == false)
@@ -204,11 +204,11 @@
/* do not attach when we're not console */
if (!console) {
- aprint_normal_dev(&sc->sc_dev, "no console, unable to continue\n");
+ aprint_normal_dev(sc->sc_dev, "no console, unable to continue\n");
return -1;
}
- aprint_verbose_dev(&sc->sc_dev, "framebuffer at %p, size %dx%d, depth %d, "
+ aprint_verbose_dev(sc->sc_dev, "framebuffer at %p, size %dx%d, depth %d, "
"stride %d\n",
sc->sc_fboffset ? (void *)(intptr_t)sc->sc_fboffset : sc->sc_fbaddr,
sc->sc_width, sc->sc_height, sc->sc_depth, sc->sc_stride);
@@ -328,7 +328,7 @@
SCREEN_DISABLE_DRAWING(&sc->sc_console_screen);
#endif
- config_found(&sc->sc_dev, &aa, wsemuldisplaydevprint);
+ config_found(sc->sc_dev, &aa, wsemuldisplaydevprint);
return 0;
}
diff -r 345184eb3373 -r 25e86d84a665 sys/dev/wsfb/genfbvar.h
--- a/sys/dev/wsfb/genfbvar.h Thu Oct 07 03:15:49 2010 +0000
+++ b/sys/dev/wsfb/genfbvar.h Thu Oct 07 07:53:53 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: genfbvar.h,v 1.16 2010/10/06 02:24:35 macallan Exp $ */
+/* $NetBSD: genfbvar.h,v 1.17 2010/10/07 07:53:53 macallan Exp $ */
/*-
* Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfbvar.h,v 1.16 2010/10/06 02:24:35 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfbvar.h,v 1.17 2010/10/07 07:53:53 macallan Exp $");
#ifndef GENFBVAR_H
#define GENFBVAR_H
@@ -78,7 +78,7 @@
};
struct genfb_softc {
- struct device sc_dev;
+ device_t sc_dev;
struct vcons_data vd;
struct genfb_ops sc_ops;
struct vcons_screen sc_console_screen;
Home |
Main Index |
Thread Index |
Old Index