diff options
| author | Christian Brueffer <brueffer@FreeBSD.org> | 2011-10-10 17:53:06 +0000 |
|---|---|---|
| committer | Christian Brueffer <brueffer@FreeBSD.org> | 2011-10-10 17:53:06 +0000 |
| commit | 0f49c72cf0d34f3d7f4ae20e066f279f458f2a36 (patch) | |
| tree | e17462bba8bab17240e87704090984d39e2524b8 /sys/dev | |
| parent | 59b5d6ed083e554916d648cc3a24fa86c269f437 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ppbus/lpt.c | 7 | ||||
| -rw-r--r-- | sys/dev/ppbus/pcfclock.c | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index 77ebaea561f5..3bc046a106f7 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -486,12 +486,15 @@ lptopen(struct cdev *dev, int flags, int fmt, struct thread *td) { int trys, err; struct lpt_data *sc = dev->si_drv1; - device_t lptdev = sc->sc_dev; - device_t ppbus = device_get_parent(lptdev); + device_t lptdev; + device_t ppbus; if (!sc) return (ENXIO); + lptdev = sc->sc_dev; + ppbus = device_get_parent(lptdev); + ppb_lock(ppbus); if (sc->sc_state) { lprintf(("%s: still open %x\n", device_get_nameunit(lptdev), diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c index e59a8919e03f..65612a21de4c 100644 --- a/sys/dev/ppbus/pcfclock.c +++ b/sys/dev/ppbus/pcfclock.c @@ -150,12 +150,14 @@ static int pcfclock_open(struct cdev *dev, int flag, int fms, struct thread *td) { struct pcfclock_data *sc = dev->si_drv1; - device_t pcfclockdev = sc->dev; - device_t ppbus = device_get_parent(pcfclockdev); + device_t pcfclockdev; + device_t ppbus; int res; if (!sc) return (ENXIO); + pcfclockdev = sc->dev; + ppbus = device_get_parent(pcfclockdev); ppb_lock(ppbus); res = ppb_request_bus(ppbus, pcfclockdev, |
