Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af668d65 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Wolfram Sang
Browse files

i2c: i801: Use match_string() helper to simplify the code



match_string() returns the array index of a matching string.
Use it instead of the open-coded implementation.

Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent c9913ac4
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@
#include <linux/io.h>
#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/wait.h>
#include <linux/err.h>
#include <linux/platform_device.h>
@@ -1172,15 +1173,13 @@ static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle,
	if (!hid)
		return AE_OK;

	for (i = 0; i < ARRAY_SIZE(acpi_smo8800_ids); ++i) {
		if (strcmp(hid, acpi_smo8800_ids[i]) == 0) {
	i = match_string(acpi_smo8800_ids, ARRAY_SIZE(acpi_smo8800_ids), hid);
	if (i < 0)
		return AE_OK;

	*((bool *)return_value) = true;
	return AE_CTRL_TERMINATE;
}
	}

	return AE_OK;
}

static bool is_dell_system_with_lis3lv02d(void)
{