diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-01-15 22:03:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2006-01-15 22:03:18 +0000 |
commit | a1b8555a256d86e34f41f9829dc7a4f2397a7fc8 (patch) | |
tree | 11dced877188951f84909a67ab7de72929447a10 /sys/dev/ic/lm78.c | |
parent | fddd2ea453bc08280eb864b7b1d12971a179c40d (diff) |
Commit missing bits too:
If we attach an lm(4) to isa(4) that is already attached to iic(4), disable
the one attached to iic(4).
idea from deraadt@
Diffstat (limited to 'sys/dev/ic/lm78.c')
-rw-r--r-- | sys/dev/ic/lm78.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/lm78.c b/sys/dev/ic/lm78.c index 344aaae4f89..816a58216de 100644 --- a/sys/dev/ic/lm78.c +++ b/sys/dev/ic/lm78.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lm78.c,v 1.1 2006/01/14 15:14:33 kettenis Exp $ */ +/* $OpenBSD: lm78.c,v 1.2 2006/01/15 22:03:17 kettenis Exp $ */ /* * Copyright (c) 2005, 2006 Mark Kettenis @@ -375,7 +375,7 @@ def_match(struct lm_softc *sc) int wb_match(struct lm_softc *sc) { - int banksel, vendid, chipid, devid; + int banksel, vendid, devid; /* Read vendor ID */ banksel = sc->lm_readreg(sc, WB_BANKSEL); @@ -391,10 +391,10 @@ wb_match(struct lm_softc *sc) /* Read device/chip ID */ sc->lm_writereg(sc, WB_BANKSEL, WB_BANKSEL_B0); devid = sc->lm_readreg(sc, LM_CHIPID); - chipid = sc->lm_readreg(sc, WB_BANK0_CHIPID); + sc->chipid = sc->lm_readreg(sc, WB_BANK0_CHIPID); sc->lm_writereg(sc, WB_BANKSEL, banksel); - DPRINTF(("winbond chip id 0x%x\n", chipid)); - switch(chipid) { + DPRINTF(("winbond chip id 0x%x\n", sc->chipid)); + switch(sc->chipid) { case WB_CHIPID_W83627HF: printf(": W83627HF\n"); lm_setup_sensors(sc, w83627hf_sensors); @@ -446,7 +446,7 @@ wb_match(struct lm_softc *sc) } break; default: - printf(": unknown Winbond chip (ID 0x%x)\n", chipid); + printf(": unknown Winbond chip (ID 0x%x)\n", sc->chipid); /* Handle as a standard LM78. */ lm_setup_sensors(sc, lm78_sensors); sc->refresh_sensor_data = lm_refresh_sensor_data; |