Use device_lookup_private() to get softc.
This commit is contained in:
parent
520a61068b
commit
13a1e15f0e
18
sys/dev/ld.c
18
sys/dev/ld.c
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ld.c,v 1.58 2008/04/28 20:23:46 martin Exp $ */
|
||||
/* $NetBSD: ld.c,v 1.59 2008/06/11 12:41:22 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.58 2008/04/28 20:23:46 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.59 2008/06/11 12:41:22 tsutsui Exp $");
|
||||
|
||||
#include "rnd.h"
|
||||
|
||||
@ -280,7 +280,7 @@ ldopen(dev_t dev, int flags, int fmt, struct lwp *l)
|
||||
int error, unit, part;
|
||||
|
||||
unit = DISKUNIT(dev);
|
||||
if ((sc = device_lookup(&ld_cd, unit)) == NULL)
|
||||
if ((sc = device_lookup_private(&ld_cd, unit)) == NULL)
|
||||
return (ENXIO);
|
||||
if ((sc->sc_flags & LDF_ENABLED) == 0)
|
||||
return (ENODEV);
|
||||
@ -328,7 +328,7 @@ ldclose(dev_t dev, int flags, int fmt, struct lwp *l)
|
||||
|
||||
unit = DISKUNIT(dev);
|
||||
part = DISKPART(dev);
|
||||
sc = device_lookup(&ld_cd, unit);
|
||||
sc = device_lookup_private(&ld_cd, unit);
|
||||
|
||||
mutex_enter(&sc->sc_dk.dk_openlock);
|
||||
|
||||
@ -383,7 +383,7 @@ ldioctl(dev_t dev, u_long cmd, void *addr, int32_t flag, struct lwp *l)
|
||||
|
||||
unit = DISKUNIT(dev);
|
||||
part = DISKPART(dev);
|
||||
sc = device_lookup(&ld_cd, unit);
|
||||
sc = device_lookup_private(&ld_cd, unit);
|
||||
|
||||
error = disk_ioctl(&sc->sc_dk, cmd, addr, flag, l);
|
||||
if (error != EPASSTHROUGH)
|
||||
@ -577,7 +577,7 @@ ldstrategy(struct buf *bp)
|
||||
daddr_t blkno;
|
||||
int s, part;
|
||||
|
||||
sc = device_lookup(&ld_cd, DISKUNIT(bp->b_dev));
|
||||
sc = device_lookup_private(&ld_cd, DISKUNIT(bp->b_dev));
|
||||
part = DISKPART(bp->b_dev);
|
||||
|
||||
if ((sc->sc_flags & LDF_DETACH) != 0) {
|
||||
@ -722,7 +722,7 @@ ldsize(dev_t dev)
|
||||
int part, unit, omask, size;
|
||||
|
||||
unit = DISKUNIT(dev);
|
||||
if ((sc = device_lookup(&ld_cd, unit)) == NULL)
|
||||
if ((sc = device_lookup_private(&ld_cd, unit)) == NULL)
|
||||
return (ENODEV);
|
||||
if ((sc->sc_flags & LDF_ENABLED) == 0)
|
||||
return (ENODEV);
|
||||
@ -809,7 +809,7 @@ lddump(dev_t dev, daddr_t blkno, void *vav, size_t size)
|
||||
static int dumping;
|
||||
|
||||
unit = DISKUNIT(dev);
|
||||
if ((sc = device_lookup(&ld_cd, unit)) == NULL)
|
||||
if ((sc = device_lookup_private(&ld_cd, unit)) == NULL)
|
||||
return (ENXIO);
|
||||
if ((sc->sc_flags & LDF_ENABLED) == 0)
|
||||
return (ENODEV);
|
||||
@ -864,7 +864,7 @@ ldminphys(struct buf *bp)
|
||||
{
|
||||
struct ld_softc *sc;
|
||||
|
||||
sc = device_lookup(&ld_cd, DISKUNIT(bp->b_dev));
|
||||
sc = device_lookup_private(&ld_cd, DISKUNIT(bp->b_dev));
|
||||
|
||||
if (bp->b_bcount > sc->sc_maxxfer)
|
||||
bp->b_bcount = sc->sc_maxxfer;
|
||||
|
Loading…
Reference in New Issue
Block a user