ACPI button: don't try to use a non-existent lid device

If a call comes in to check the lid state but there's no lid device
present, we should return -ENODEV.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Jesse Barnes 2009-10-07 14:39:46 -07:00 committed by Len Brown
parent 2906206350
commit 2c907b72db
1 changed files with 3 additions and 0 deletions

View File

@ -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))