summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-11 10:58:22 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-11 10:58:22 +0000
commit9c004cc2365ad1f8f4d15f93aafe072be63c9933 (patch)
tree1ee8278f27078e79e93cd7f1025b52a0fa0bd87c
parent63545cda9325b2156532c81096c04f0c47c4566d (diff)
Remove the definition and use of the USB_GET_SC macro, no binary change.
ok mk.
-rw-r--r--sys/dev/usb/ugen.c14
-rw-r--r--sys/dev/usb/uhid.c14
-rw-r--r--sys/dev/usb/ulpt.c6
-rw-r--r--sys/dev/usb/urio.c10
-rw-r--r--sys/dev/usb/usb.c4
-rw-r--r--sys/dev/usb/usb_port.h5
-rw-r--r--sys/dev/usb/uscanner.c12
7 files changed, 31 insertions, 34 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 4393764fcb0..9845271716e 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ugen.c,v 1.44 2007/06/11 09:26:55 mk Exp $ */
+/* $OpenBSD: ugen.c,v 1.45 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */
/* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -409,7 +409,7 @@ ugenclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
int dir;
int i;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
DPRINTFN(5, ("ugenclose: flag=%d, mode=%d, unit=%d, endpt=%d\n",
flag, mode, UGENUNIT(dev), endpt));
@@ -613,7 +613,7 @@ ugenread(dev_t dev, struct uio *uio, int flag)
struct ugen_softc *sc;
int error;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
sc->sc_refcnt++;
error = ugen_do_read(sc, endpt, uio, flag);
@@ -712,7 +712,7 @@ ugenwrite(dev_t dev, struct uio *uio, int flag)
struct ugen_softc *sc;
int error;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
sc->sc_refcnt++;
error = ugen_do_write(sc, endpt, uio, flag);
@@ -1258,7 +1258,7 @@ ugenioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
struct ugen_softc *sc;
int error;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
sc->sc_refcnt++;
error = ugen_do_ioctl(sc, endpt, cmd, addr, flag, p);
@@ -1275,7 +1275,7 @@ ugenpoll(dev_t dev, int events, usb_proc_ptr p)
int revents = 0;
int s;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
if (sc->sc_dying)
return (POLLERR);
@@ -1387,7 +1387,7 @@ ugenkqfilter(dev_t dev, struct knote *kn)
struct klist *klist;
int s;
- USB_GET_SC(ugen, UGENUNIT(dev), sc);
+ sc = ugen_cd.cd_devs[UGENUNIT(dev)];
if (sc->sc_dying)
return (1);
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 9dee93d92f6..83c6406ea55 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.36 2007/06/11 09:26:55 mk Exp $ */
+/* $OpenBSD: uhid.c,v 1.37 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -265,7 +265,7 @@ uhidclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
{
struct uhid_softc *sc;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
DPRINTF(("uhidclose: sc=%p\n", sc));
@@ -341,7 +341,7 @@ uhidread(dev_t dev, struct uio *uio, int flag)
struct uhid_softc *sc;
int error;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
sc->sc_refcnt++;
error = uhid_do_read(sc, uio, flag);
@@ -383,7 +383,7 @@ uhidwrite(dev_t dev, struct uio *uio, int flag)
struct uhid_softc *sc;
int error;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
sc->sc_refcnt++;
error = uhid_do_write(sc, uio, flag);
@@ -513,7 +513,7 @@ uhidioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
struct uhid_softc *sc;
int error;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
sc->sc_refcnt++;
error = uhid_do_ioctl(sc, cmd, addr, flag, p);
@@ -529,7 +529,7 @@ uhidpoll(dev_t dev, int events, usb_proc_ptr p)
int revents = 0;
int s;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
if (sc->sc_dying)
return (POLLERR);
@@ -585,7 +585,7 @@ uhidkqfilter(dev_t dev, struct knote *kn)
struct klist *klist;
int s;
- USB_GET_SC(uhid, UHIDUNIT(dev), sc);
+ sc = uhid_cd.cd_devs[UHIDUNIT(dev)];
if (sc->sc_dying)
return (EIO);
diff --git a/sys/dev/usb/ulpt.c b/sys/dev/usb/ulpt.c
index e52813d70d5..6203454ca2c 100644
--- a/sys/dev/usb/ulpt.c
+++ b/sys/dev/usb/ulpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ulpt.c,v 1.27 2007/06/10 14:49:01 mbalmer Exp $ */
+/* $OpenBSD: ulpt.c,v 1.28 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: ulpt.c,v 1.57 2003/01/05 10:19:42 scw Exp $ */
/* $FreeBSD: src/sys/dev/usb/ulpt.c,v 1.24 1999/11/17 22:33:44 n_hibma Exp $ */
@@ -540,7 +540,7 @@ ulptclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
{
struct ulpt_softc *sc;
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
+ sc = ulpt_cd.cd_devs[ULPTUNIT(dev)];
if (sc->sc_state != ULPT_OPEN)
/* We are being forced to close before the open completed. */
@@ -613,7 +613,7 @@ ulptwrite(dev_t dev, struct uio *uio, int flags)
struct ulpt_softc *sc;
int error;
- USB_GET_SC(ulpt, ULPTUNIT(dev), sc);
+ sc = ulpt_cd.cd_devs[ULPTUNIT(dev)];
if (sc->sc_dying)
return (EIO);
diff --git a/sys/dev/usb/urio.c b/sys/dev/usb/urio.c
index 82091f8c597..7cb9fd00d62 100644
--- a/sys/dev/usb/urio.c
+++ b/sys/dev/usb/urio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: urio.c,v 1.27 2007/06/10 14:49:01 mbalmer Exp $ */
+/* $OpenBSD: urio.c,v 1.28 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: urio.c,v 1.15 2002/10/23 09:14:02 jdolecek Exp $ */
/*
@@ -283,7 +283,7 @@ int
urioclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
{
struct urio_softc *sc;
- USB_GET_SC(urio, URIOUNIT(dev), sc);
+ sc = urio_cd.cd_devs[URIOUNIT(dev)];
DPRINTFN(5, ("urioclose: flag=%d, mode=%d, unit=%d\n",
flag, mode, URIOUNIT(dev)));
@@ -312,7 +312,7 @@ urioread(dev_t dev, struct uio *uio, int flag)
u_int32_t n, tn;
int error = 0;
- USB_GET_SC(urio, URIOUNIT(dev), sc);
+ sc = urio_cd.cd_devs[URIOUNIT(dev)];
DPRINTFN(5, ("urioread: %d\n", URIOUNIT(dev)));
@@ -369,7 +369,7 @@ uriowrite(dev_t dev, struct uio *uio, int flag)
u_int32_t n;
int error = 0;
- USB_GET_SC(urio, URIOUNIT(dev), sc);
+ sc = urio_cd.cd_devs[URIOUNIT(dev)];
DPRINTFN(5, ("uriowrite: unit=%d, len=%ld\n", URIOUNIT(dev),
(long)uio->uio_resid));
@@ -437,7 +437,7 @@ urioioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, usb_proc_ptr p)
void *ptr = NULL;
int error = 0;
- USB_GET_SC(urio, unit, sc);
+ sc = urio_cd.cd_devs[unit];
if (sc->sc_dying)
return (EIO);
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index ff47575c85e..0b99e1b9e06 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.c,v 1.49 2007/06/11 09:26:55 mk Exp $ */
+/* $OpenBSD: usb.c,v 1.50 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
/*
@@ -464,7 +464,7 @@ usbioctl(dev_t devt, u_long cmd, caddr_t data, int flag, usb_proc_ptr p)
}
}
- USB_GET_SC(usb, unit, sc);
+ sc = usb_cd.cd_devs[unit];
if (sc->sc_dying)
return (EIO);
diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h
index c8fd0892559..7cac0b5d370 100644
--- a/sys/dev/usb/usb_port.h
+++ b/sys/dev/usb/usb_port.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb_port.h,v 1.82 2007/06/11 09:26:55 mk Exp $ */
+/* $OpenBSD: usb_port.h,v 1.83 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */
@@ -116,7 +116,4 @@ const struct cfattach __CONCAT(dname,_ca) = { \
if (sc == NULL) \
return (ENXIO)
-#define USB_GET_SC(dname, unit, sc) \
- sc = __CONCAT(dname,_cd).cd_devs[unit]
-
#endif /* _USB_PORT_H */
diff --git a/sys/dev/usb/uscanner.c b/sys/dev/usb/uscanner.c
index 93f5d83e969..b25e040b53f 100644
--- a/sys/dev/usb/uscanner.c
+++ b/sys/dev/usb/uscanner.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uscanner.c,v 1.30 2007/06/11 09:26:55 mk Exp $ */
+/* $OpenBSD: uscanner.c,v 1.31 2007/06/11 10:58:21 mbalmer Exp $ */
/* $NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $ */
/*
@@ -391,7 +391,7 @@ uscannerclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
{
struct uscanner_softc *sc;
- USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
+ sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
DPRINTFN(5, ("uscannerclose: flag=%d, mode=%d, unit=%d\n",
flag, mode, USCANNERUNIT(dev)));
@@ -490,7 +490,7 @@ uscannerread(dev_t dev, struct uio *uio, int flag)
struct uscanner_softc *sc;
int error;
- USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
+ sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
sc->sc_refcnt++;
error = uscanner_do_read(sc, uio, flag);
@@ -540,7 +540,7 @@ uscannerwrite(dev_t dev, struct uio *uio, int flag)
struct uscanner_softc *sc;
int error;
- USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
+ sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
sc->sc_refcnt++;
error = uscanner_do_write(sc, uio, flag);
@@ -610,7 +610,7 @@ uscannerpoll(dev_t dev, int events, usb_proc_ptr p)
struct uscanner_softc *sc;
int revents = 0;
- USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
+ sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
if (sc->sc_dying)
return (POLLERR);
@@ -652,7 +652,7 @@ uscannerkqfilter(dev_t dev, struct knote *kn)
struct uscanner_softc *sc;
struct klist *klist;
- USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
+ sc = uscanner_cd.cd_devs[USCANNERUNIT(dev)];
if (sc->sc_dying)
return (1);