.. | .. |
---|
758 | 758 | gflags = GPIOD_OUT_HIGH; |
---|
759 | 759 | else |
---|
760 | 760 | gflags = GPIOD_OUT_LOW; |
---|
| 761 | + gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE; |
---|
761 | 762 | gpiod = devm_gpiod_get_optional(&client->dev, |
---|
762 | 763 | "maxim,enable", |
---|
763 | 764 | gflags); |
---|
.. | .. |
---|
807 | 808 | config.of_node = client->dev.of_node; |
---|
808 | 809 | config.regmap = max->regmap; |
---|
809 | 810 | |
---|
810 | | - /* Register the regulators */ |
---|
| 811 | + /* |
---|
| 812 | + * Register the regulators |
---|
| 813 | + * Turn the GPIO descriptor over to the regulator core for |
---|
| 814 | + * lifecycle management if we pass an ena_gpiod. |
---|
| 815 | + */ |
---|
| 816 | + if (config.ena_gpiod) |
---|
| 817 | + devm_gpiod_unhinge(&client->dev, config.ena_gpiod); |
---|
811 | 818 | rdev = devm_regulator_register(&client->dev, &max->desc, &config); |
---|
812 | 819 | if (IS_ERR(rdev)) { |
---|
813 | 820 | ret = PTR_ERR(rdev); |
---|