Skip to content

Commit

Permalink
Merge back ACPI device enumeration material for v5.18.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael J. Wysocki committed Mar 18, 2022
2 parents 462ccc3 + ad2f3b0 commit bf978a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ void acpi_scan_table_notify(void);

extern struct list_head acpi_bus_id_list;

#define ACPI_MAX_DEVICE_INSTANCES 4096

struct acpi_device_bus_id {
const char *bus_id;
struct ida instance_ida;
Expand Down
5 changes: 3 additions & 2 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ static void acpi_device_del(struct acpi_device *device)
list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node)
if (!strcmp(acpi_device_bus_id->bus_id,
acpi_device_hid(device))) {
ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no);
ida_free(&acpi_device_bus_id->instance_ida,
device->pnp.instance_no);
if (ida_is_empty(&acpi_device_bus_id->instance_ida)) {
list_del(&acpi_device_bus_id->node);
kfree_const(acpi_device_bus_id->bus_id);
Expand Down Expand Up @@ -642,7 +643,7 @@ static int acpi_device_set_name(struct acpi_device *device,
struct ida *instance_ida = &acpi_device_bus_id->instance_ida;
int result;

result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL);
result = ida_alloc(instance_ida, GFP_KERNEL);
if (result < 0)
return result;

Expand Down

0 comments on commit bf978a8

Please sign in to comment.