diff options
| author | dyoung <dyoung@NetBSD.org> | 2008-07-01 23:19:48 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2008-07-01 23:19:48 +0000 |
| commit | dcfcd6affa7346a9c7dee7d73756cd65be3de9a5 (patch) | |
| tree | 23e9e128c96032a92cf60be3c9a72a5fc3861bd6 /sys/dev/pci | |
| parent | be6f2a4b871a15303f8b49d2fa83348acfd9a570 (diff) | |
Cosmetic: use device_t, cfdata_t, __arraycount(), device_private().
Diffstat (limited to 'sys/dev/pci')
| -rw-r--r-- | sys/dev/pci/machfb.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/sys/dev/pci/machfb.c b/sys/dev/pci/machfb.c index 632d639ba52..658d7ea7d20 100644 --- a/sys/dev/pci/machfb.c +++ b/sys/dev/pci/machfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: machfb.c,v 1.53 2008/06/12 22:44:47 cegger Exp $ */ +/* $NetBSD: machfb.c,v 1.54 2008/07/01 23:19:48 dyoung Exp $ */ /* * Copyright (c) 2002 Bang Jun-Young @@ -33,7 +33,7 @@ #include <sys/cdefs.h> __KERNEL_RCSID(0, - "$NetBSD: machfb.c,v 1.53 2008/06/12 22:44:47 cegger Exp $"); + "$NetBSD: machfb.c,v 1.54 2008/07/01 23:19:48 dyoung Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -219,8 +219,8 @@ static struct videomode mach64_modes[] = { extern const u_char rasops_cmap[768]; -static int mach64_match(struct device *, struct cfdata *, void *); -static void mach64_attach(struct device *, struct device *, void *); +static int mach64_match(device_t, cfdata_t, void *); +static void mach64_attach(device_t, device_t, void *); CFATTACH_DECL(machfb, sizeof(struct mach64_softc), mach64_match, mach64_attach, NULL, NULL); @@ -366,7 +366,7 @@ static const struct wsscreen_descr *_mach64_scrlist[] = { }; static struct wsscreen_list mach64_screenlist = { - sizeof(_mach64_scrlist) / sizeof(struct wsscreen_descr *), + __arraycount(_mach64_scrlist), _mach64_scrlist }; @@ -394,7 +394,7 @@ static struct vcons_screen mach64_console_screen; /* framebuffer device, SPARC-only so far */ #ifdef __sparc__ -static void machfb_unblank(struct device *); +static void machfb_unblank(device_t); static void machfb_fbattach(struct mach64_softc *); extern struct cfdriver machfb_cd; @@ -468,8 +468,7 @@ wait_for_idle(struct mach64_softc *sc) } static int -mach64_match(struct device *parent, struct cfdata *match, - void *aux) +mach64_match(device_t parent, cfdata_t match, void *aux) { struct pci_attach_args *pa = (struct pci_attach_args *)aux; int i; @@ -478,7 +477,7 @@ mach64_match(struct device *parent, struct cfdata *match, PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_DISPLAY_VGA) return 0; - for (i = 0; i < sizeof(mach64_info) / sizeof(mach64_info[0]); i++) + for (i = 0; i < __arraycount(mach64_info); i++) if (PCI_PRODUCT(pa->pa_id) == mach64_info[i].chip_id) { mach64_chip_id = PCI_PRODUCT(pa->pa_id); mach64_chip_rev = PCI_REVISION(pa->pa_class); @@ -489,9 +488,9 @@ mach64_match(struct device *parent, struct cfdata *match, } static void -mach64_attach(struct device *parent, struct device *self, void *aux) +mach64_attach(device_t parent, device_t self, void *aux) { - struct mach64_softc *sc = (void *)self; + struct mach64_softc *sc = device_private(self); struct pci_attach_args *pa = aux; struct rasops_info *ri; char devinfo[256]; @@ -790,7 +789,7 @@ mach64_get_max_ramdac(struct mach64_softc *sc) (mach64_chip_rev & 0x07)) return 170000; - for (i = 0; i < sizeof(mach64_info) / sizeof(mach64_info[0]); i++) + for (i = 0; i < __arraycount(mach64_info); i++) if (mach64_chip_id == mach64_info[i].chip_id) return mach64_info[i].ramdac_freq; @@ -1774,9 +1773,9 @@ machfb_blank(struct mach64_softc *sc, int blank) #ifdef __sparc__ static void -machfb_unblank(struct device *dev) +machfb_unblank(device_t dev) { - struct mach64_softc *sc = (struct mach64_softc *)dev; + struct mach64_softc *sc = device_private(dev); machfb_blank(sc, 0); } |
