]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - sound/soc/codecs/cs35l32.c
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[karo-tx-linux.git] / sound / soc / codecs / cs35l32.c
index f2b8aad21274aec951fdabc20887b970ef2e1aaa..60598b23034111cb8646b7a8607bca95db79cf01 100644 (file)
@@ -437,20 +437,13 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
        }
 
        /* Reset the Device */
-       cs35l32->reset_gpio = devm_gpiod_get(&i2c_client->dev,
-               "reset-gpios");
-       if (IS_ERR(cs35l32->reset_gpio)) {
-               ret = PTR_ERR(cs35l32->reset_gpio);
-               if (ret != -ENOENT && ret != -ENOSYS)
-                       return ret;
-
-               cs35l32->reset_gpio = NULL;
-       } else {
-               ret = gpiod_direction_output(cs35l32->reset_gpio, 0);
-               if (ret)
-                       return ret;
+       cs35l32->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
+               "reset", GPIOD_OUT_LOW);
+       if (IS_ERR(cs35l32->reset_gpio))
+               return PTR_ERR(cs35l32->reset_gpio);
+
+       if (cs35l32->reset_gpio)
                gpiod_set_value_cansleep(cs35l32->reset_gpio, 1);
-       }
 
        /* initialize codec */
        ret = regmap_read(cs35l32->regmap, CS35L32_DEVID_AB, &reg);