Skip to contentSkip to conversation

ACPI: video: simplify code with acpi_get_local_u64_address()

PATCH Applied Andy Shevchenko 2 participants 2 messages Jan 21 – Jan 23 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI: video: simplify code with acpi_get_local_u64_address()

Now we have a helper so there's no need to open-code.

---

v2: removed now unused variable (LKP)

 drivers/acpi/acpi_video.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/acpi/acpi_video.c +2 -4
index 944aba605c1a..69469757b965 100644
@@ -1134,13 +1134,11 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
 	struct acpi_video_bus *video = arg;
 	struct acpi_video_device_attrib *attribute;
 	struct acpi_video_device *data;
-	unsigned long long device_id;
-	acpi_status status;
 	int device_type;
+	u64 device_id;
 
-	status = acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
 	/* Skip devices without _ADR instead of failing. */
-	if (ACPI_FAILURE(status))
+	if (acpi_get_local_u64_address(device->handle, &device_id))
 		goto exit;
 
 	data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
Signature · 1 line
2.50.1
maintainer Applied
#1 lore raw
Quoted 22 lines · Andy Shevchenko

Now we have a helper so there's no need to open-code.

---

v2: removed now unused variable (LKP)

 drivers/acpi/acpi_video.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/acpi/acpi_video.c +0 -2
index 944aba605c1a..69469757b965 100644
@@ -1134,13 +1134,11 @@ static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)
        struct acpi_video_bus *video = arg;
        struct acpi_video_device_attrib *attribute;
        struct acpi_video_device *data;
-       unsigned long long device_id;
-       acpi_status status;
        int device_type;

drivers/acpi/acpi_video.c static int acpi_video_bus_get_one_device(struct acpi_device *device, void *arg)

Quoted 10 lines
drivers/acpi/acpi_video.c +2 -3
+       u64 device_id;
 
-       status = acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id);
        /* Skip devices without _ADR instead of failing. */
-       if (ACPI_FAILURE(status))
+       if (acpi_get_local_u64_address(device->handle, &device_id))
                goto exit;
 
        data = kzalloc(sizeof(struct acpi_video_device), GFP_KERNEL);
--

Applied as 6.20 material, thanks!