From patchwork Wed Oct 7 21:39:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 52356 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n97LnjEq010376 for ; Wed, 7 Oct 2009 21:49:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754439AbZJGVrP (ORCPT ); Wed, 7 Oct 2009 17:47:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754101AbZJGVrO (ORCPT ); Wed, 7 Oct 2009 17:47:14 -0400 Received: from outbound-mail-152.bluehost.com ([67.222.39.32]:60669 "HELO outbound-mail-152.bluehost.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754439AbZJGVrO (ORCPT ); Wed, 7 Oct 2009 17:47:14 -0400 X-Greylist: delayed 399 seconds by postgrey-1.27 at vger.kernel.org; Wed, 07 Oct 2009 17:47:14 EDT Received: (qmail 27018 invoked by uid 0); 7 Oct 2009 21:39:58 -0000 Received: from unknown (HELO box514.bluehost.com) (74.220.219.114) by outboundproxy5.bluehost.com with SMTP; 7 Oct 2009 21:39:58 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=virtuousgeek.org; h=Received:Date:From:To:Subject:Message-ID:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=NmY9812MvmEeEX4Hhu3kublucedKwUmba4ZD0kwvamebwduxSzzaPrjL3N3zAaADRg7dMmz9fO3QIOlUp7NWnIzS2fRVtJ5Qe+tNn0wT587HeC+nktFM9ngrE6N4W6se; Received: from [75.111.28.251] (helo=jbarnes-g45) by box514.bluehost.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1MveEo-0000PE-ED; Wed, 07 Oct 2009 15:39:58 -0600 Date: Wed, 7 Oct 2009 14:39:46 -0700 From: Jesse Barnes To: Len Brown , intel-gfx@lists.freedesktop.org, linux-acpi@vger.kernel.org Subject: [PATCH] ACPI button: don't try to use a non-existent lid device Message-ID: <20091007143946.3fad3fa8@jbarnes-g45> X-Mailer: Claws Mail 3.7.2 (GTK+ 2.17.5; i486-pc-linux-gnu) Mime-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 75.111.28.251 authed with jbarnes@virtuousgeek.org} Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 9335b87..0c9c6a9 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -251,6 +251,9 @@ int acpi_lid_open(void) acpi_status status; unsigned long long state; + if (!lid_device) + return -ENODEV; + status = acpi_evaluate_integer(lid_device->handle, "_LID", NULL, &state); if (ACPI_FAILURE(status))