Commit 40381a3c authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Rafael J. Wysocki

ACPI / scan: Simplify acpi_bus_extract_wakeup_device_power_package()

acpi_bus_extract_wakeup_device_power_package() is a static function
with a single caller that supplies (device->handle, &device->wakeup).

Simplify the interface so the caller need only supply "device".

This makes it obvious that "wakeup", i.e., &device->wakeup, can never
be NULL, so remove the unnecessary check for that.
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 8c2ffd91
...@@ -763,18 +763,16 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) ...@@ -763,18 +763,16 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
} }
EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, static int acpi_bus_extract_wakeup_device_power_package(struct acpi_device *dev)
struct acpi_device_wakeup *wakeup)
{ {
acpi_handle handle = dev->handle;
struct acpi_device_wakeup *wakeup = &dev->wakeup;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
union acpi_object *package = NULL; union acpi_object *package = NULL;
union acpi_object *element = NULL; union acpi_object *element = NULL;
acpi_status status; acpi_status status;
int err = -ENODATA; int err = -ENODATA;
if (!wakeup)
return -EINVAL;
INIT_LIST_HEAD(&wakeup->resources); INIT_LIST_HEAD(&wakeup->resources);
/* _PRW */ /* _PRW */
...@@ -883,8 +881,7 @@ static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device) ...@@ -883,8 +881,7 @@ static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
if (!acpi_has_method(device->handle, "_PRW")) if (!acpi_has_method(device->handle, "_PRW"))
return; return;
err = acpi_bus_extract_wakeup_device_power_package(device->handle, err = acpi_bus_extract_wakeup_device_power_package(device);
&device->wakeup);
if (err) { if (err) {
dev_err(&device->dev, "_PRW evaluation error: %d\n", err); dev_err(&device->dev, "_PRW evaluation error: %d\n", err);
return; return;
......
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