use device_lookup_private to get softc

This commit is contained in:
cegger 2008-06-11 20:52:14 +00:00
parent 40e1c73ac2
commit 5819fc04b4
2 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cir.c,v 1.20 2008/04/28 20:23:51 martin Exp $ */
/* $NetBSD: cir.c,v 1.21 2008/06/11 20:52:14 cegger Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.20 2008/04/28 20:23:51 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.21 2008/06/11 20:52:14 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -139,7 +139,7 @@ ciropen(dev_t dev, int flag, int mode, struct lwp *l)
struct cir_softc *sc;
int error;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (ENXIO);
if (!device_is_active(&sc->sc_dev))
@ -162,7 +162,7 @@ circlose(dev_t dev, int flag, int mode, struct lwp *l)
struct cir_softc *sc;
int error;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (ENXIO);
if (sc->sc_methods->im_close != NULL)
@ -179,7 +179,7 @@ cirread(dev_t dev, struct uio *uio, int flag)
{
struct cir_softc *sc;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (ENXIO);
if (!device_is_active(&sc->sc_dev))
@ -192,7 +192,7 @@ cirwrite(dev_t dev, struct uio *uio, int flag)
{
struct cir_softc *sc;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (ENXIO);
if (!device_is_active(&sc->sc_dev))
@ -206,7 +206,7 @@ cirioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
struct cir_softc *sc;
int error;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (ENXIO);
if (!device_is_active(&sc->sc_dev))
@ -241,7 +241,7 @@ cirpoll(dev_t dev, int events, struct lwp *l)
int revents;
int s;
sc = device_lookup(&cir_cd, CIRUNIT(dev));
sc = device_lookup_private(&cir_cd, CIRUNIT(dev));
if (sc == NULL)
return (POLLERR);
if (!device_is_active(&sc->sc_dev))

View File

@ -1,4 +1,4 @@
/* $NetBSD: gtmpsc.c,v 1.28 2008/04/08 20:40:42 cegger Exp $ */
/* $NetBSD: gtmpsc.c,v 1.29 2008/06/11 20:55:41 cegger Exp $ */
/*
* Copyright (c) 2002 Allegro Networks, Inc., Wasabi Systems, Inc.
@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.28 2008/04/08 20:40:42 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: gtmpsc.c,v 1.29 2008/06/11 20:55:41 cegger Exp $");
#include "opt_kgdb.h"
@ -1339,7 +1339,7 @@ gtmpsccngetc(dev_t dev)
unit = GTMPSCUNIT(dev);
if (major(dev) != 0) {
struct gtmpsc_softc *sc = device_lookup(&gtmpsc_cd, unit);
struct gtmpsc_softc *sc = device_lookup_private(&gtmpsc_cd, unit);
if (sc == NULL)
return 0;
unit = sc->gtmpsc_unit;
@ -1366,7 +1366,7 @@ gtmpsccnputc(dev_t dev, int c)
unit = GTMPSCUNIT(dev);
if (major(dev) != 0) {
struct gtmpsc_softc *sc = device_lookup(&gtmpsc_cd, unit);
struct gtmpsc_softc *sc = device_lookup_private(&gtmpsc_cd, unit);
if (sc == NULL)
return;
unit = sc->gtmpsc_unit;