Commit 21ba074c authored by Hans de Goede's avatar Hans de Goede Committed by Rafael J. Wysocki

ACPI / x86: utils: Remove status workaround from acpi_device_always_present()

Now that we init the status field to ACPI_STA_DEFAULT rather then to 0,
the workaround for acpi_match_device_ids() always returning -ENOENT when
status is 0 is no longer needed.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent d0ed4c60
...@@ -109,13 +109,9 @@ static const struct always_present_id always_present_ids[] = { ...@@ -109,13 +109,9 @@ static const struct always_present_id always_present_ids[] = {
bool acpi_device_always_present(struct acpi_device *adev) bool acpi_device_always_present(struct acpi_device *adev)
{ {
u32 *status = (u32 *)&adev->status;
u32 old_status = *status;
bool ret = false; bool ret = false;
unsigned int i; unsigned int i;
/* acpi_match_device_ids checks status, so set it to default */
*status = ACPI_STA_DEFAULT;
for (i = 0; i < ARRAY_SIZE(always_present_ids); i++) { for (i = 0; i < ARRAY_SIZE(always_present_ids); i++) {
if (acpi_match_device_ids(adev, always_present_ids[i].hid)) if (acpi_match_device_ids(adev, always_present_ids[i].hid))
continue; continue;
...@@ -131,15 +127,9 @@ bool acpi_device_always_present(struct acpi_device *adev) ...@@ -131,15 +127,9 @@ bool acpi_device_always_present(struct acpi_device *adev)
!dmi_check_system(always_present_ids[i].dmi_ids)) !dmi_check_system(always_present_ids[i].dmi_ids))
continue; continue;
if (old_status != ACPI_STA_DEFAULT) /* Log only once */
dev_info(&adev->dev,
"Device [%s] is in always present list\n",
adev->pnp.bus_id);
ret = true; ret = true;
break; break;
} }
*status = old_status;
return ret; return ret;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment