Use device_lookup_private() rather than using cd_devs[] directly to get softc.

This commit is contained in:
tsutsui 2008-06-08 18:35:25 +00:00
parent 9499107496
commit 62e807c2fe

View File

@ -1,4 +1,4 @@
/* $NetBSD: pckbc_pnpbios.c,v 1.16 2008/04/28 20:23:25 martin Exp $ */
/* $NetBSD: pckbc_pnpbios.c,v 1.17 2008/06/08 18:35:25 tsutsui Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pckbc_pnpbios.c,v 1.16 2008/04/28 20:23:25 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: pckbc_pnpbios.c,v 1.17 2008/06/08 18:35:25 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -195,7 +195,7 @@ pckbc_pnpbios_intr_establish(struct pckbc_softc *sc,
* Note we're always called with sc == first.
*/
for (i = 0; i < pckbc_cd.cd_ndevs; i++) {
psc = pckbc_cd.cd_devs[i];
psc = device_lookup_private(&pckbc_cd, i);
if (psc && psc->sc_slot == slot) {
irq = psc->sc_irq;
ist = psc->sc_ist;