diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-12-16 15:43:15 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2015-12-16 15:43:15 +0000 |
commit | c67bff6d2121c5d0885a029c6a4a37d7a17034c1 (patch) | |
tree | 2c55315f42d0d0c124294ebced3a924052bcc745 /sys/dev/acpi | |
parent | 70cc4fddbf822c50152f99b7ddac261cb93d9992 (diff) |
Don't attempt to get the ThinkLight state if neither the KLCG nor the MLCG
methods are present. Should fix the panic that occurs on older ThinkPads
(such as the x201) when you press the ThinkLight key.
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r-- | sys/dev/acpi/acpithinkpad.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/acpi/acpithinkpad.c b/sys/dev/acpi/acpithinkpad.c index 687f7cc5a24..ebc4f3e48f2 100644 --- a/sys/dev/acpi/acpithinkpad.c +++ b/sys/dev/acpi/acpithinkpad.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpithinkpad.c,v 1.48 2015/12/14 18:48:50 kettenis Exp $ */ +/* $OpenBSD: acpithinkpad.c,v 1.49 2015/12/16 15:43:14 kettenis Exp $ */ /* * Copyright (c) 2008 joshua stein <jcs@openbsd.org> * @@ -583,8 +583,9 @@ thinkpad_activate(struct device *self, int act) void thinkpad_get_thinklight(struct acpithinkpad_softc *sc) { - aml_evalinteger(sc->sc_acpi, sc->sc_devnode, - sc->sc_thinklight_get, 0, NULL, &sc->sc_thinklight); + if (sc->sc_thinklight_get) + aml_evalinteger(sc->sc_acpi, sc->sc_devnode, + sc->sc_thinklight_get, 0, NULL, &sc->sc_thinklight); } void |