From owner-svn-src-head@FreeBSD.ORG Wed Apr 22 21:23:10 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0B08106566B for ; Wed, 22 Apr 2009 21:23:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [IPv6:2001:16d8:fffb:4::abba]) by mx1.freebsd.org (Postfix) with ESMTP id 42B398FC1F for ; Wed, 22 Apr 2009 21:23:10 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from DSPAM-Daemon (localhost [127.0.0.1]) by mx0.deglitch.com (Postfix) with SMTP id 4CCAF8FC51 for ; Thu, 23 Apr 2009 01:23:09 +0400 (MSD) Received: from orion.SpringDaemons.com (unknown [77.232.3.143]) by mx0.deglitch.com (Postfix) with ESMTPA id 91C428FC18; Thu, 23 Apr 2009 01:23:06 +0400 (MSD) Received: from orion (localhost [127.0.0.1]) by orion.SpringDaemons.com (Postfix) with SMTP id 1AD2639827; Thu, 23 Apr 2009 01:23:06 +0400 (MSD) Date: Thu, 23 Apr 2009 01:23:06 +0400 From: Stanislav Sedov To: Ed Schouten Message-Id: <20090423012306.01a2e5e4.stas@FreeBSD.org> In-Reply-To: <200904141402.n3EE2hwB007748@svn.freebsd.org> References: <200904141402.n3EE2hwB007748@svn.freebsd.org> Organization: The FreeBSD Project X-XMPP: ssedov@jabber.ru X-Voice: +7 916 849 20 23 X-PGP-Fingerprint: F21E D6CC 5626 9609 6CE2 A385 2BF5 5993 EB26 9581 X-Mailer: carrier-pigeon Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-DSPAM-Result: Whitelisted X-DSPAM-Processed: Thu Apr 23 01:23:09 2009 X-DSPAM-Confidence: 0.9899 X-DSPAM-Improbability: 1 in 9809 chance of being spam X-DSPAM-Probability: 0.0000 X-DSPAM-Signature: 49ef8abd967007051094092 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r191060 - in head/sys/dev: twa twe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Apr 2009 21:23:11 -0000 On Tue, 14 Apr 2009 14:02:43 +0000 (UTC) Ed Schouten mentioned: > Author: ed > Date: Tue Apr 14 14:02:43 2009 > New Revision: 191060 > URL: http://svn.freebsd.org/changeset/base/191060 > > Log: > Use si_drv1 instead of dev2unit() in twe(4) and twa(4) > > Reviewed by: scottl > > Modified: > head/sys/dev/twa/tw_osl_freebsd.c > head/sys/dev/twe/twe_freebsd.c > > Modified: head/sys/dev/twa/tw_osl_freebsd.c > ============================================================================== > --- head/sys/dev/twa/tw_osl_freebsd.c Tue Apr 14 13:43:09 2009 (r191059) > +++ head/sys/dev/twa/tw_osl_freebsd.c Tue Apr 14 14:02:43 2009 (r191060) > @@ -88,8 +88,7 @@ static devclass_t twa_devclass; > static TW_INT32 > twa_open(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc) > { > - TW_INT32 unit = dev2unit(dev); > - struct twa_softc *sc = devclass_get_softc(twa_devclass, unit); > + struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1); > > tw_osli_dbg_dprintf(5, sc, "entered"); > sc->state |= TW_OSLI_CTLR_STATE_OPEN; > @@ -114,8 +113,7 @@ twa_open(struct cdev *dev, TW_INT32 flag > static TW_INT32 > twa_close(struct cdev *dev, TW_INT32 flags, TW_INT32 fmt, d_thread_t *proc) > { > - TW_INT32 unit = dev2unit(dev); > - struct twa_softc *sc = devclass_get_softc(twa_devclass, unit); > + struct twa_softc *sc = (struct twa_softc *)(dev->si_drv1); > > tw_osli_dbg_dprintf(5, sc, "entered"); > sc->state &= ~TW_OSLI_CTLR_STATE_OPEN; > > Modified: head/sys/dev/twe/twe_freebsd.c > ============================================================================== > --- head/sys/dev/twe/twe_freebsd.c Tue Apr 14 13:43:09 2009 (r191059) > +++ head/sys/dev/twe/twe_freebsd.c Tue Apr 14 14:02:43 2009 (r191060) > @@ -81,8 +81,7 @@ static struct cdevsw twe_cdevsw = { > static int > twe_open(struct cdev *dev, int flags, int fmt, d_thread_t *td) > { > - int unit = dev2unit(dev); > - struct twe_softc *sc = devclass_get_softc(twe_devclass, unit); > + struct twe_softc *sc = (struct twe_softc *)dev->si_drv1; > > sc->twe_state |= TWE_STATE_OPEN; > return(0); > @@ -94,8 +93,7 @@ twe_open(struct cdev *dev, int flags, in > static int > twe_close(struct cdev *dev, int flags, int fmt, d_thread_t *td) > { > - int unit = dev2unit(dev); > - struct twe_softc *sc = devclass_get_softc(twe_devclass, unit); > + struct twe_softc *sc = (struct twe_softc *)dev->si_drv1; ^^^^^^^^^ Any reason to have two tabs here? -- Stanislav Sedov ST4096-RIPE !DSPAM:49ef8abd967007051094092!