diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2021-08-06 23:15:15 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2021-09-29 21:36:35 +0200 |
commit | 2b3db4db660f9cc04878d81c2517f840763e6733 (patch) | |
tree | 8613d107fbca684fd03bdb4f9254338057e8288c /drivers/i2c/busses | |
parent | i2c: xiic: Fix RX IRQ busy check (diff) | |
download | linux-2b3db4db660f9cc04878d81c2517f840763e6733.tar.xz linux-2b3db4db660f9cc04878d81c2517f840763e6733.zip |
i2c: i801: Improve is_dell_system_with_lis3lv02d
Replace the ugly cast of the return_value pointer with proper usage.
In addition use dmi_match() instead of open-coding it.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-i801.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c index 89ae78ef1a1c..f56060fcf5ac 100644 --- a/drivers/i2c/busses/i2c-i801.c +++ b/drivers/i2c/busses/i2c-i801.c @@ -1192,7 +1192,7 @@ static acpi_status check_acpi_smo88xx_device(acpi_handle obj_handle, kfree(info); - *((bool *)return_value) = true; + *return_value = NULL; return AE_CTRL_TERMINATE; smo88xx_not_found: @@ -1202,11 +1202,9 @@ smo88xx_not_found: static bool is_dell_system_with_lis3lv02d(void) { - bool found; - const char *vendor; + void *err = ERR_PTR(-ENOENT); - vendor = dmi_get_system_info(DMI_SYS_VENDOR); - if (!vendor || strcmp(vendor, "Dell Inc.")) + if (!dmi_match(DMI_SYS_VENDOR, "Dell Inc.")) return false; /* @@ -1217,11 +1215,9 @@ static bool is_dell_system_with_lis3lv02d(void) * accelerometer but unfortunately ACPI does not provide any other * information (like I2C address). */ - found = false; - acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL, - (void **)&found); + acpi_get_devices(NULL, check_acpi_smo88xx_device, NULL, &err); - return found; + return !IS_ERR(err); } /* |