]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/regulator/max8973-regulator.c
ALSA: sparc: Constify snd_kcontrol_new items
[linux.git] / drivers / regulator / max8973-regulator.c
index e7a58b50903203f81b669b5fa2b51031d574a090..9aee1444181dad29b9f21e980292996e62632706 100644 (file)
@@ -808,7 +808,13 @@ static int max8973_probe(struct i2c_client *client,
        config.of_node = client->dev.of_node;
        config.regmap = max->regmap;
 
-       /* Register the regulators */
+       /*
+        * Register the regulators
+        * Turn the GPIO descriptor over to the regulator core for
+        * lifecycle management if we pass an ena_gpiod.
+        */
+       if (config.ena_gpiod)
+               devm_gpiod_unhinge(&client->dev, config.ena_gpiod);
        rdev = devm_regulator_register(&client->dev, &max->desc, &config);
        if (IS_ERR(rdev)) {
                ret = PTR_ERR(rdev);