Skip to content

Commit

Permalink
ACPI / PM: Do not apply ACPI_SUCCESS() to acpi_bus_get_device() result
Browse files Browse the repository at this point in the history
Since the return value of acpi_bus_get_device() is not of type
acpi_status, ACPI_SUCCESS() should not be used for checking its
return value.  Fix that.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
  • Loading branch information
Rafael J. Wysocki committed Jan 3, 2013
1 parent 8611ea5 commit 5cc36c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/acpi/device_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ static struct acpi_device *acpi_dev_pm_get_node(struct device *dev)
acpi_handle handle = DEVICE_ACPI_HANDLE(dev);
struct acpi_device *adev;

return handle && ACPI_SUCCESS(acpi_bus_get_device(handle, &adev)) ?
adev : NULL;
return handle && !acpi_bus_get_device(handle, &adev) ? adev : NULL;
}

/**
Expand Down

0 comments on commit 5cc36c7

Please sign in to comment.