Skip to content

Commit b5bdb60

Browse files
James Morserafaeljw
authored andcommitted
ACPI: scan: Use the acpi_device_is_present() helper in more places
acpi_device_is_present() checks the present or functional bits from the cached copy of _STA. A few places open-code this check. Use the helper instead to improve readability. Signed-off-by: James Morse <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Miguel Luis <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5872080 commit b5bdb60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/acpi/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ static int acpi_scan_device_check(struct acpi_device *adev)
304304
int error;
305305

306306
acpi_bus_get_status(adev);
307-
if (adev->status.present || adev->status.functional) {
307+
if (acpi_device_is_present(adev)) {
308308
/*
309309
* This function is only called for device objects for which
310310
* matching scan handlers exist. The only situation in which
@@ -338,7 +338,7 @@ static int acpi_scan_bus_check(struct acpi_device *adev, void *not_used)
338338
int error;
339339

340340
acpi_bus_get_status(adev);
341-
if (!(adev->status.present || adev->status.functional)) {
341+
if (!acpi_device_is_present(adev)) {
342342
acpi_scan_device_not_present(adev);
343343
return 0;
344344
}

0 commit comments

Comments
 (0)