Input: da7280 - fix missing error test
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 16 Dec 2020 01:41:16 +0000 (17:41 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 16 Dec 2020 01:43:00 +0000 (17:43 -0800)
An "if" testing for error condition has accidentally been dropped from
the code.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
Reviewed-by: Roy Im <Roy.Im.Opensource@diasemi.com>
Link: https://lore.kernel.org/r/X9j8lGFgijzHyYZZ@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/da7280.c

index 37568b0..2f698a8 100644 (file)
@@ -863,6 +863,7 @@ static void da7280_parse_properties(struct device *dev,
                gpi_str3[7] = '0' + i;
                haptics->gpi_ctl[i].polarity = 0;
                error = device_property_read_string(dev, gpi_str3, &str);
+               if (!error)
                        haptics->gpi_ctl[i].polarity =
                                da7280_haptic_of_gpi_pol_str(dev, str);
        }