]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/slg51000-regulator.c
regulator: twl: voltage lists for vdd1/2 on twl4030
[linux.git] / drivers / regulator / slg51000-regulator.c
index 04b732991d6955f3cf917644725be7fff756acd3..4d859fef55e681e81701fb023f0842b23f2413ff 100644 (file)
@@ -205,7 +205,7 @@ static int slg51000_of_parse_cb(struct device_node *np,
        ena_gpiod = devm_gpiod_get_from_of_node(chip->dev, np,
                                                "enable-gpios", 0,
                                                gflags, "gpio-en-ldo");
-       if (ena_gpiod) {
+       if (!IS_ERR(ena_gpiod)) {
                config->ena_gpiod = ena_gpiod;
                devm_gpiod_unhinge(chip->dev, config->ena_gpiod);
        }
@@ -459,7 +459,7 @@ static int slg51000_i2c_probe(struct i2c_client *client,
                                               GPIOD_OUT_HIGH
                                               | GPIOD_FLAGS_BIT_NONEXCLUSIVE,
                                               "slg51000-cs");
-       if (cs_gpiod) {
+       if (!IS_ERR(cs_gpiod)) {
                dev_info(dev, "Found chip selector property\n");
                chip->cs_gpiod = cs_gpiod;
        }