From owner-svn-src-all@FreeBSD.ORG Sat Apr 18 07:36:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC6431065670; Sat, 18 Apr 2009 07:36:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F01C8FC08; Sat, 18 Apr 2009 07:36:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3I7ac4j059820; Sat, 18 Apr 2009 07:36:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3I7acqZ059818; Sat, 18 Apr 2009 07:36:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200904180736.n3I7acqZ059818@svn.freebsd.org> From: Ed Schouten Date: Sat, 18 Apr 2009 07:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191242 - in head/sys/dev: mlx mly X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2009 07:36:39 -0000 Author: ed Date: Sat Apr 18 07:36:38 2009 New Revision: 191242 URL: http://svn.freebsd.org/changeset/base/191242 Log: Convert mlx(4) and mly(4) to si_drv1 instead of dev2unit(). Modified: head/sys/dev/mlx/mlx.c head/sys/dev/mly/mly.c Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Sat Apr 18 06:06:47 2009 (r191241) +++ head/sys/dev/mlx/mlx.c Sat Apr 18 07:36:38 2009 (r191242) @@ -474,8 +474,9 @@ mlx_attach(struct mlx_softc *sc) /* * Create the control device. */ - sc->mlx_dev_t = make_dev(&mlx_cdevsw, device_get_unit(sc->mlx_dev), UID_ROOT, GID_OPERATOR, + sc->mlx_dev_t = make_dev(&mlx_cdevsw, 0, UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, "mlx%d", device_get_unit(sc->mlx_dev)); + sc->mlx_dev_t->si_drv1 = sc; /* * Start the timeout routine. @@ -711,8 +712,7 @@ mlx_submit_buf(struct mlx_softc *sc, mlx int mlx_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit); + struct mlx_softc *sc = dev->si_drv1; sc->mlx_state |= MLX_STATE_OPEN; return(0); @@ -724,8 +724,7 @@ mlx_open(struct cdev *dev, int flags, in int mlx_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit); + struct mlx_softc *sc = dev->si_drv1; sc->mlx_state &= ~MLX_STATE_OPEN; return (0); @@ -737,8 +736,7 @@ mlx_close(struct cdev *dev, int flags, i int mlx_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int32_t flag, struct thread *td) { - int unit = dev2unit(dev); - struct mlx_softc *sc = devclass_get_softc(mlx_devclass, unit); + struct mlx_softc *sc = dev->si_drv1; struct mlx_rebuild_request *rb = (struct mlx_rebuild_request *)addr; struct mlx_rebuild_status *rs = (struct mlx_rebuild_status *)addr; int *arg = (int *)addr; Modified: head/sys/dev/mly/mly.c ============================================================================== --- head/sys/dev/mly/mly.c Sat Apr 18 06:06:47 2009 (r191241) +++ head/sys/dev/mly/mly.c Sat Apr 18 07:36:38 2009 (r191242) @@ -310,7 +310,7 @@ mly_attach(device_t dev) /* * Create the control device. */ - sc->mly_dev_t = make_dev(&mly_cdevsw, device_get_unit(sc->mly_dev), UID_ROOT, GID_OPERATOR, + sc->mly_dev_t = make_dev(&mly_cdevsw, 0, UID_ROOT, GID_OPERATOR, S_IRUSR | S_IWUSR, "mly%d", device_get_unit(sc->mly_dev)); sc->mly_dev_t->si_drv1 = sc; @@ -2834,8 +2834,7 @@ mly_print_controller(int controller) static int mly_user_open(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit); + struct mly_softc *sc = dev->si_drv1; sc->mly_state |= MLY_STATE_OPEN; return(0); @@ -2847,8 +2846,7 @@ mly_user_open(struct cdev *dev, int flag static int mly_user_close(struct cdev *dev, int flags, int fmt, struct thread *td) { - int unit = dev2unit(dev); - struct mly_softc *sc = devclass_get_softc(devclass_find("mly"), unit); + struct mly_softc *sc = dev->si_drv1; sc->mly_state &= ~MLY_STATE_OPEN; return (0);