Consistently pass a "struct piixpm_softc" to piixpm_intr.

Prevents a crash on hardware interrupts.
This commit is contained in:
hannken 2014-06-22 09:48:20 +00:00
parent 4f7c01f703
commit 4e4497b37e

View File

@ -1,4 +1,4 @@
/* $NetBSD: piixpm.c,v 1.44 2014/03/29 19:28:25 christos Exp $ */
/* $NetBSD: piixpm.c,v 1.45 2014/06/22 09:48:20 hannken Exp $ */
/* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */
/*
@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.44 2014/03/29 19:28:25 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.45 2014/06/22 09:48:20 hannken Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -508,7 +508,7 @@ piixpm_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr,
}
if (st & PIIX_SMB_HS_BUSY)
goto timeout;
piixpm_intr(smbus);
piixpm_intr(sc);
} else {
/* Wait for interrupt */
if (tsleep(sc, PRIBIO, "iicexec", PIIXPM_TIMEOUT * hz))
@ -543,8 +543,7 @@ timeout:
static int
piixpm_intr(void *arg)
{
struct piixpm_smbus *smbus = arg;
struct piixpm_softc *sc = smbus->softc;
struct piixpm_softc *sc = arg;
u_int8_t st;
u_int8_t *b;
size_t len;