Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/mac68k/dev/ncr5380.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/mac68k/dev/ncr5380.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.64 retrieving revision 1.64.20.2 diff -u -p -r1.64 -r1.64.20.2 --- src/sys/arch/mac68k/dev/ncr5380.c 2010/02/28 15:52:16 1.64 +++ src/sys/arch/mac68k/dev/ncr5380.c 2014/08/20 00:03:11 1.64.20.2 @@ -1,4 +1,4 @@ -/* $NetBSD: ncr5380.c,v 1.64 2010/02/28 15:52:16 snj Exp $ */ +/* $NetBSD: ncr5380.c,v 1.64.20.2 2014/08/20 00:03:11 tls Exp $ */ /* * Copyright (c) 1995 Leo Weppelman. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.64 2010/02/28 15:52:16 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ncr5380.c,v 1.64.20.2 2014/08/20 00:03:11 tls Exp $"); /* * Bit mask of targets you want debugging to be shown @@ -167,8 +167,8 @@ extern inline void finish_req(SC_REQ *re /* * Auto config stuff.... */ -void ncr_attach(struct device *, struct device *, void *); -int ncr_match(struct device *, struct cfdata *, void *); +void ncr_attach(device_t, device_t, void *); +int ncr_match(device_t, cfdata_t, void *); /* * Tricks to make driver-name configurable @@ -178,26 +178,28 @@ int ncr_match(struct device *, struct cf #define CFSTRING(n) __STRING(n) #define CFDRNAME(n) n -CFATTACH_DECL(CFDRNAME(DRNAME), sizeof(struct ncr_softc), +CFATTACH_DECL_NEW(CFDRNAME(DRNAME), sizeof(struct ncr_softc), ncr_match, ncr_attach, NULL, NULL); extern struct cfdriver CFNAME(DRNAME); int -ncr_match(struct device *parent, struct cfdata *cf, void *aux) +ncr_match(device_t parent, cfdata_t cf, void *aux) { + return (machine_match(parent, cf, aux, &CFNAME(DRNAME))); } void -ncr_attach(struct device *pdp, struct device *dp, void *auxp) +ncr_attach(device_t parent, device_t self, void *aux) { struct ncr_softc *sc; int i; - sc = (struct ncr_softc *)dp; + sc = device_private(self); - sc->sc_adapter.adapt_dev = &sc->sc_dev; + sc->sc_dev = self; + sc->sc_adapter.adapt_dev = self; sc->sc_adapter.adapt_openings = 7; sc->sc_adapter.adapt_max_periph = 1; sc->sc_adapter.adapt_ioctl = NULL; @@ -245,7 +247,7 @@ ncr_attach(struct device *pdp, struct de /* * attach all scsi units on us */ - config_found(dp, &sc->sc_channel, scsiprint); + config_found(self, &sc->sc_channel, scsiprint); } /* @@ -260,8 +262,7 @@ ncr5380_scsi_request(struct scsipi_chann void *arg) { struct scsipi_xfer *xs; - struct scsipi_periph *periph; - struct ncr_softc *sc = (void *)chan->chan_adapter->adapt_dev; + struct ncr_softc *sc = device_private(chan->chan_adapter->adapt_dev); int sps, flags; SC_REQ *reqp, *link, *tmp; @@ -269,7 +270,6 @@ ncr5380_scsi_request(struct scsipi_chann case ADAPTER_REQ_RUN_XFER: xs = arg; flags = xs->xs_control; - periph = xs->xs_periph; /* * We do not queue RESET commands @@ -696,7 +696,7 @@ scsi_select(SC_REQ *reqp, int code) u_int8_t targ_bit; struct ncr_softc *sc; - sc = (void *)reqp->xs->xs_periph->periph_channel->chan_adapter->adapt_dev; + sc = device_private(reqp->xs->xs_periph->periph_channel->chan_adapter->adapt_dev); DBG_SELPRINT ("Starting arbitration\n", 0); PID("scsi_select1"); @@ -1627,7 +1627,6 @@ static int reach_msg_out(struct ncr_softc *sc, u_long len) { u_char phase; - u_char data; u_long n = len; ncr_aprint(sc, "Trying to reach Message-out phase\n"); @@ -1646,7 +1645,7 @@ reach_msg_out(struct ncr_softc *sc, u_lo if (((GET_5380_REG(NCR5380_IDSTAT) >> 2) & 7) != phase) break; if (PH_IN(phase)) { - data = GET_5380_REG(NCR5380_DATA); + GET_5380_REG(NCR5380_DATA); SET_5380_REG(NCR5380_ICOM, SC_A_ACK | SC_A_ATN); } else { @@ -1898,7 +1897,7 @@ ncr_aprint(struct ncr_softc *sc, const c va_list ap; va_start(ap, fmt); - printf("%s: ", sc->sc_dev.dv_xname); + printf("%s: ", device_xname(sc->sc_dev)); vprintf(fmt, ap); va_end(ap); }