diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2017-06-06 12:37:36 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-06-22 03:55:34 +0300 |
commit | cde1f95f407a593ad6baf1b7b01daa2c6cbd34fd (patch) | |
tree | 2797687bbdb77a7a23b39b3d55dd955bf42bdfcc /drivers/acpi/scan.c | |
parent | 2b8153421de8c29864cb147f241804858440bfa1 (diff) | |
download | linux-cde1f95f407a593ad6baf1b7b01daa2c6cbd34fd.tar.xz |
ACPI: Constify argument to acpi_device_is_present()
This will be needed in constifying the fwnode API.
The side effects the function had have been moved to the callers.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 3a10d7573477..c98f88b28948 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1567,13 +1567,9 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type, return 0; } -bool acpi_device_is_present(struct acpi_device *adev) +bool acpi_device_is_present(const struct acpi_device *adev) { - if (adev->status.present || adev->status.functional) - return true; - - adev->flags.initialized = false; - return false; + return adev->status.present || adev->status.functional; } static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler, @@ -1831,6 +1827,7 @@ static void acpi_bus_attach(struct acpi_device *device) acpi_bus_get_status(device); /* Skip devices that are not present. */ if (!acpi_device_is_present(device)) { + device->flags.initialized = false; acpi_device_clear_enumerated(device); device->flags.power_manageable = 0; return; |