]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/input/misc/drv260x.c
Merge tag 'sound-fix-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
[karo-tx-linux.git] / drivers / input / misc / drv260x.c
index 599578042ea0b578632fd702d4eb7902c5f979cd..e5d60ecd29a4d6adc2ae63cdfe69fea935edeb58 100644 (file)
@@ -580,15 +580,10 @@ static int drv260x_probe(struct i2c_client *client,
                return error;
        }
 
-       haptics->enable_gpio = devm_gpiod_get(&client->dev, "enable");
-       if (IS_ERR(haptics->enable_gpio)) {
-               error = PTR_ERR(haptics->enable_gpio);
-               if (error != -ENOENT && error != -ENOSYS)
-                       return error;
-               haptics->enable_gpio = NULL;
-       } else {
-               gpiod_direction_output(haptics->enable_gpio, 1);
-       }
+       haptics->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
+                                                      GPIOD_OUT_HIGH);
+       if (IS_ERR(haptics->enable_gpio))
+               return PTR_ERR(haptics->enable_gpio);
 
        haptics->input_dev = devm_input_allocate_device(&client->dev);
        if (!haptics->input_dev) {