Commit d7296af8 authored by Armin Wolf's avatar Armin Wolf Committed by Hans de Goede

platform/x86: dell-sysman: Improve instance detection

The WMI driver core already knows how many WMI object instances
are available, use this information instead of probing the WMI object
manually.

Compile-tested only.
Signed-off-by: default avatarArmin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230430203153.5587-3-W_Armin@gmx.deReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 2a2b13ae
...@@ -303,16 +303,13 @@ union acpi_object *get_wmiobj_pointer(int instance_id, const char *guid_string) ...@@ -303,16 +303,13 @@ union acpi_object *get_wmiobj_pointer(int instance_id, const char *guid_string)
*/ */
int get_instance_count(const char *guid_string) int get_instance_count(const char *guid_string)
{ {
union acpi_object *wmi_obj = NULL; int ret;
int i = 0;
do { ret = wmi_instance_count(guid_string);
kfree(wmi_obj); if (ret < 0)
wmi_obj = get_wmiobj_pointer(i, guid_string); return 0;
i++;
} while (wmi_obj);
return (i-1); return ret;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment