summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-05-08 07:02:41 +0000
committerphk <phk@FreeBSD.org>1999-05-08 07:02:41 +0000
commitbac74fbd5437e3b09bdcbbe1a58698e0fc6aab8b (patch)
tree64550e00285b8b98137f77e0130d6b4285790397 /sys/dev
parent31167e1a820f19bcb6a06bf97cbead60ae7105d6 (diff)
downloadFreeBSD-src-bac74fbd5437e3b09bdcbbe1a58698e0fc6aab8b.zip
FreeBSD-src-bac74fbd5437e3b09bdcbbe1a58698e0fc6aab8b.tar.gz
Fix some of the places where too much inside knowledge about major/minor
layout and dev_t structure is being (ab)used.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/dgb/dgb.c7
-rw-r--r--sys/dev/dgb/dgm.c7
-rw-r--r--sys/dev/mcd/mcd.c4
-rw-r--r--sys/dev/si/si.c6
-rw-r--r--sys/dev/usb/ugen.c4
5 files changed, 13 insertions, 15 deletions
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c
index 127dfe9..e9a044b 100644
--- a/sys/dev/dgb/dgb.c
+++ b/sys/dev/dgb/dgb.c
@@ -1,5 +1,5 @@
/*-
- * dgb.c $Id: dgb.c,v 1.46 1999/04/28 10:51:55 dt Exp $
+ * dgb.c $Id: dgb.c,v 1.47 1999/05/02 21:39:52 peter Exp $
*
* Digiboard driver.
*
@@ -1953,9 +1953,8 @@ dgbparam(tp, t)
struct tty *tp;
struct termios *t;
{
- int dev=tp->t_dev;
- int unit=MINOR_TO_UNIT(dev);
- int pnum=MINOR_TO_PORT(dev);
+ int unit=MINOR_TO_UNIT(minor(tp->t_dev));
+ int pnum=MINOR_TO_PORT(minor(tp->t_dev));
struct dgb_softc *sc=&dgb_softc[unit];
struct dgb_p *port=&sc->ports[pnum];
volatile struct board_chan *bc=port->brdchan;
diff --git a/sys/dev/dgb/dgm.c b/sys/dev/dgb/dgm.c
index e274ea7..291e520 100644
--- a/sys/dev/dgb/dgm.c
+++ b/sys/dev/dgb/dgm.c
@@ -1,5 +1,5 @@
/*-
- * $Id: dgm.c,v 1.11 1999/05/02 21:39:52 peter Exp $
+ * $Id: dgm.c,v 1.12 1999/05/03 09:32:31 brian Exp $
*
* This driver and the associated header files support the ISA PC/Xem
* Digiboards. Its evolutionary roots are described below.
@@ -1757,9 +1757,8 @@ dgmparam(tp, t)
struct tty *tp;
struct termios *t;
{
- int dev=tp->t_dev;
- int unit=MINOR_TO_UNIT(dev);
- int pnum=MINOR_TO_PORT(dev);
+ int unit=MINOR_TO_UNIT(minor(tp->t_dev));
+ int pnum=MINOR_TO_PORT(minor(tp->t_dev));
struct dgm_softc *sc=&dgm_softc[unit];
struct dgm_p *port=&sc->ports[pnum];
volatile struct board_chan *bc=port->brdchan;
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index b53883e..8af4105 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.104 1999/05/06 18:54:17 peter Exp $
+ * $Id: mcd.c,v 1.105 1999/05/07 07:03:27 phk Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -225,7 +225,7 @@ static struct cdevsw mcd_cdevsw = {
mcdioctl, nostop, nullreset, nodevtotty,
seltrue, nommap, mcdstrategy, "mcd",
NULL, -1, nodump, nopsize,
- D_DISK, 0, NODEV };
+ D_DISK};
#define mcd_put(port,byte) outb(port,byte)
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index 52f672b..8cdef5c 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.82 1999/04/28 10:52:52 dt Exp $
+ * $Id: si.c,v 1.83 1999/05/02 20:35:44 peter Exp $
*/
#ifndef lint
@@ -2751,8 +2751,8 @@ si_dprintf(pp, flags, fmt, va_alist)
(pp != NULL && ((pp->sp_debug&flags) || (si_debug&flags)))) {
if (pp != NULL)
printf("%ci%d(%d): ", 's',
- (int)SI_CARD(pp->sp_tty->t_dev),
- (int)SI_PORT(pp->sp_tty->t_dev));
+ (int)SI_CARD(minor(pp->sp_tty->t_dev)),
+ (int)SI_PORT(minor(pp->sp_tty->t_dev)));
va_start(ap, fmt);
vprintf(fmt, ap);
va_end(ap);
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index bebd853..d073769 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -141,8 +141,8 @@ usb_config_descriptor_t *ugen_get_cdesc __P((struct ugen_softc *sc, int index,
usbd_status ugen_set_interface __P((struct ugen_softc *, int, int));
int ugen_get_alt_index __P((struct ugen_softc *sc, int ifaceidx));
-#define UGENUNIT(n) (((n) >> 4) & 0xf)
-#define UGENENDPOINT(n) ((n) & 0xf)
+#define UGENUNIT(n) ((minor(n) >> 4) & 0xf)
+#define UGENENDPOINT(n) (minor(n) & 0xf)
USB_DECLARE_DRIVER(ugen);
OpenPOWER on IntegriCloud