use device_lookup_private to get softc
This commit is contained in:
parent
ba04e43210
commit
8e3892d445
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: xlcom.c,v 1.6 2008/01/09 08:15:53 elad Exp $ */
|
||||
/* $NetBSD: xlcom.c,v 1.7 2008/06/11 23:52:36 cegger Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006 Jachym Holecek
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: xlcom.c,v 1.6 2008/01/09 08:15:53 elad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: xlcom.c,v 1.7 2008/06/11 23:52:36 cegger Exp $");
|
||||
|
||||
#include "opt_kgdb.h"
|
||||
|
||||
@ -396,7 +396,7 @@ xlcom_open(dev_t dev, int flags, int mode, struct lwp *l)
|
||||
struct tty *tp;
|
||||
int error, s;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
|
||||
@ -452,7 +452,7 @@ xlcom_read(dev_t dev, struct uio *uio, int flag)
|
||||
struct xlcom_softc *sc;
|
||||
struct tty *tp;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
tp = sc->sc_tty;
|
||||
@ -466,7 +466,7 @@ xlcom_write(dev_t dev, struct uio *uio, int flag)
|
||||
struct xlcom_softc *sc;
|
||||
struct tty *tp;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
tp = sc->sc_tty;
|
||||
@ -480,7 +480,7 @@ xlcom_poll(dev_t dev, int events, struct lwp *l)
|
||||
struct xlcom_softc *sc;
|
||||
struct tty *tp;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
tp = sc->sc_tty;
|
||||
@ -494,7 +494,7 @@ xlcom_tty(dev_t dev)
|
||||
struct xlcom_softc *sc;
|
||||
struct tty *tp;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (NULL);
|
||||
tp = sc->sc_tty;
|
||||
@ -509,7 +509,7 @@ xlcom_ioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
|
||||
struct tty *tp;
|
||||
int error;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
tp = sc->sc_tty;
|
||||
@ -533,7 +533,7 @@ xlcom_close(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
struct xlcom_softc *sc;
|
||||
struct tty *tp;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, minor(dev));
|
||||
sc = device_lookup_private(&xlcom_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return (ENXIO);
|
||||
tp = sc->sc_tty;
|
||||
@ -554,7 +554,7 @@ xlcom_stop(struct tty *tp, int flag)
|
||||
struct xlcom_softc *sc;
|
||||
int s;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, UNIT(tp->t_dev));
|
||||
sc = device_lookup_private(&xlcom_cd, UNIT(tp->t_dev));
|
||||
if (sc == NULL)
|
||||
return ;
|
||||
|
||||
@ -590,7 +590,7 @@ xlcom_start(struct tty *tp)
|
||||
struct xlcom_softc *sc;
|
||||
int s1, s2;
|
||||
|
||||
sc = device_lookup(&xlcom_cd, UNIT(tp->t_dev));
|
||||
sc = device_lookup_private(&xlcom_cd, UNIT(tp->t_dev));
|
||||
if (sc == NULL)
|
||||
return ;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: flash_vrip.c,v 1.6 2008/04/28 20:23:22 martin Exp $ */
|
||||
/* $NetBSD: flash_vrip.c,v 1.7 2008/06/11 23:53:15 cegger Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.6 2008/04/28 20:23:22 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: flash_vrip.c,v 1.7 2008/06/11 23:53:15 cegger Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
@ -312,7 +312,8 @@ flashopen(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
struct flash_softc *sc;
|
||||
|
||||
if ((sc = device_lookup(&flash_cd, minor(dev))) == NULL)
|
||||
sc = device_lookup_private(&flash_cd, minor(dev));
|
||||
if (sc == NULL)
|
||||
return ENXIO;
|
||||
if (sc->sc_status & FLASH_ST_BUSY)
|
||||
return EBUSY;
|
||||
@ -325,7 +326,7 @@ flashclose(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
struct flash_softc *sc;
|
||||
|
||||
sc = device_lookup(&flash_cd, minor(dev));
|
||||
sc = device_lookup_private(&flash_cd, minor(dev));
|
||||
sc->sc_status &= ~FLASH_ST_BUSY;
|
||||
return 0;
|
||||
}
|
||||
@ -341,7 +342,7 @@ flashread(dev_t dev, struct uio *uio, int flag)
|
||||
int count;
|
||||
int error;
|
||||
|
||||
sc = device_lookup(&flash_cd, minor(dev));
|
||||
sc = device_lookup_private(&flash_cd, minor(dev));
|
||||
iot = sc->sc_iot;
|
||||
ioh = sc->sc_ioh;
|
||||
|
||||
@ -370,7 +371,7 @@ flashwrite(dev_t dev, struct uio *uio, int flag)
|
||||
int stat;
|
||||
int error;
|
||||
|
||||
sc = device_lookup(&flash_cd, minor(dev));
|
||||
sc = device_lookup_private(&flash_cd, minor(dev));
|
||||
|
||||
if (sc->sc_size < uio->uio_offset + uio->uio_resid)
|
||||
return ENOSPC;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: vr4181aiu.c,v 1.5 2008/04/28 20:23:22 martin Exp $ */
|
||||
/* $NetBSD: vr4181aiu.c,v 1.6 2008/06/11 23:53:15 cegger Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
@ -30,7 +30,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: vr4181aiu.c,v 1.5 2008/04/28 20:23:22 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: vr4181aiu.c,v 1.6 2008/06/11 23:53:15 cegger Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
@ -235,7 +235,8 @@ vr4181aiuopen(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
struct vr4181aiu_softc *sc;
|
||||
|
||||
if ((sc = device_lookup(&vr4181aiu_cd, minor(dev))) == NULL)
|
||||
sc = device_lookup_private(&vr4181aiu_cd, minor(dev);
|
||||
if (sc == NULL)
|
||||
return ENXIO;
|
||||
|
||||
if (sc->sc_status & ST_BUSY)
|
||||
@ -301,7 +302,7 @@ vr4181aiuopen(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
int
|
||||
vr4181aiuclose(dev_t dev, int flag, int mode, struct lwp *l)
|
||||
{
|
||||
vr4181aiu_disable(device_lookup(&vr4181aiu_cd, minor(dev)));
|
||||
vr4181aiu_disable(device_lookup_private(&vr4181aiu_cd, minor(dev)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -317,7 +318,7 @@ vr4181aiuread(dev_t dev, struct uio *uio, int flag)
|
||||
u_int16_t *src;
|
||||
u_int8_t *dst;
|
||||
|
||||
sc = device_lookup(&vr4181aiu_cd, minor(dev));
|
||||
sc = device_lookup_private(&vr4181aiu_cd, minor(dev));
|
||||
|
||||
src = sc->sc_inbuf_tail;
|
||||
s = splbio();
|
||||
|
Loading…
Reference in New Issue
Block a user