From ed2b61ded73a6c011789da1f8d2ae0f55226c643 Mon Sep 17 00:00:00 2001 From: drochner Date: Thu, 3 Apr 2008 17:04:40 +0000 Subject: [PATCH] update for device/softc split, thanks to Risto Sainio for testing --- sys/arch/hpcmips/dev/plumohci.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/arch/hpcmips/dev/plumohci.c b/sys/arch/hpcmips/dev/plumohci.c index 319dac3169ef..a7ba2d7df531 100644 --- a/sys/arch/hpcmips/dev/plumohci.c +++ b/sys/arch/hpcmips/dev/plumohci.c @@ -1,4 +1,4 @@ -/* $NetBSD: plumohci.c,v 1.11 2007/03/04 05:59:52 christos Exp $ */ +/* $NetBSD: plumohci.c,v 1.12 2008/04/03 17:04:40 drochner Exp $ */ /*- * Copyright (c) 2000 UCHIYAMA Yasushi @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: plumohci.c,v 1.11 2007/03/04 05:59:52 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: plumohci.c,v 1.12 2008/04/03 17:04:40 drochner Exp $"); #include #include @@ -116,7 +116,7 @@ struct plumohci_softc { LIST_HEAD(, plumohci_shm) sc_shm_head; }; -CFATTACH_DECL(plumohci, sizeof(struct plumohci_softc), +CFATTACH_DECL_NEW(plumohci, sizeof(struct plumohci_softc), plumohci_match, plumohci_attach, NULL, NULL); int @@ -130,10 +130,13 @@ plumohci_match(struct device *parent, struct cfdata *match, void *aux) void plumohci_attach(struct device *parent, struct device *self, void *aux) { - struct plumohci_softc *sc = (struct plumohci_softc *)self; + struct plumohci_softc *sc = device_private(self); struct plum_attach_args *pa = aux; usbd_status r; + sc->sc.sc_dev = self; + sc->sc.sc_bus.hci_private = sc; + sc->sc.iot = pa->pa_iot; sc->sc.sc_bus.dmatag = &plumohci_bus_dma_tag.bdt; plumohci_bus_dma_tag._dmamap_chipset_v = sc; @@ -188,8 +191,7 @@ plumohci_attach(struct device *parent, struct device *self, void *aux) } /* Attach usb device. */ - sc->sc.sc_child = config_found((void *) sc, &sc->sc.sc_bus, - usbctlprint); + sc->sc.sc_child = config_found(self, &sc->sc.sc_bus, usbctlprint); } int