From c67bff6d2121c5d0885a029c6a4a37d7a17034c1 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 16 Dec 2015 15:43:15 +0000 Subject: 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. --- sys/dev/acpi/acpithinkpad.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sys/dev/acpi/acpithinkpad.c') 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 * @@ -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 -- cgit v1.2.3