We only care about if there is any successful match from the dmi table
or no match at all, we can make dmi_check_system return immediately if
we have a successful match instead of iterate thorough the whole table.

Signed-off-by: Axel Lin <[email protected]>
---
 drivers/platform/x86/chromeos_laptop.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/chromeos_laptop.c 
b/drivers/platform/x86/chromeos_laptop.c
index 93d6680..b6018d4 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -207,7 +207,7 @@ static int __init setup_cyapa_smbus_tp(const struct 
dmi_system_id *id)
 {
        /* add cyapa touchpad on smbus */
        tp = add_smbus_device("trackpad", &cyapa_device);
-       return 0;
+       return 1;
 }
 
 static int __init setup_atmel_224s_tp(const struct dmi_system_id *id)
@@ -219,7 +219,7 @@ static int __init setup_atmel_224s_tp(const struct 
dmi_system_id *id)
        /* add atmel mxt touchpad on VGA DDC GMBus */
        tp = add_probed_i2c_device("trackpad", I2C_ADAPTER_VGADDC,
                                   &atmel_224s_tp_device, addr_list);
-       return 0;
+       return 1;
 }
 
 static int __init setup_atmel_1664s_ts(const struct dmi_system_id *id)
@@ -231,7 +231,7 @@ static int __init setup_atmel_1664s_ts(const struct 
dmi_system_id *id)
        /* add atmel mxt touch device on PANEL GMBus */
        ts = add_probed_i2c_device("touchscreen", I2C_ADAPTER_PANEL,
                                   &atmel_1664s_device, addr_list);
-       return 0;
+       return 1;
 }
 
 
@@ -239,7 +239,7 @@ static int __init setup_isl29018_als(const struct 
dmi_system_id *id)
 {
        /* add isl29018 light sensor */
        als = add_smbus_device("lightsensor", &isl_als_device);
-       return 0;
+       return 1;
 }
 
 static int __init setup_isl29023_als(const struct dmi_system_id *id)
@@ -247,21 +247,21 @@ static int __init setup_isl29023_als(const struct 
dmi_system_id *id)
        /* add isl29023 light sensor on Panel GMBus */
        als = add_i2c_device("lightsensor", I2C_ADAPTER_PANEL,
                             &isl_als_device);
-       return 0;
+       return 1;
 }
 
 static int __init setup_tsl2583_als(const struct dmi_system_id *id)
 {
        /* add tsl2583 light sensor on smbus */
        als = add_smbus_device(NULL, &tsl2583_als_device);
-       return 0;
+       return 1;
 }
 
 static int __init setup_tsl2563_als(const struct dmi_system_id *id)
 {
        /* add tsl2563 light sensor on smbus */
        als = add_smbus_device(NULL, &tsl2563_als_device);
-       return 0;
+       return 1;
 }
 
 static struct dmi_system_id __initdata chromeos_laptop_dmi_table[] = {
-- 
1.7.9.5



--
To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" 
in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to