diff mbox series

[v8-rc1,08/20] squash! max9286: Convert to use devm_regulator_get()

Message ID 20200416104052.2643098-9-jacopo+renesas@jmondi.org (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series GMSL: max9286-v8-rc1 + RDAMC20-v8 | expand

Commit Message

Jacopo Mondi April 16, 2020, 10:40 a.m. UTC
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>

 - Convert to use devm_regulator_get()
---
 drivers/media/i2c/max9286.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/max9286.c b/drivers/media/i2c/max9286.c
index d0749c537152..08fd946c25f0 100644
--- a/drivers/media/i2c/max9286.c
+++ b/drivers/media/i2c/max9286.c
@@ -1187,7 +1187,7 @@  static int max9286_probe(struct i2c_client *client)
 	if (ret)
 		goto err_powerdown;
 
-	priv->regulator = regulator_get(&client->dev, "poc");
+	priv->regulator = devm_regulator_get(&client->dev, "poc");
 	if (IS_ERR(priv->regulator)) {
 		if (PTR_ERR(priv->regulator) != -EPROBE_DEFER)
 			dev_err(&client->dev,
@@ -1249,7 +1249,6 @@  static int max9286_remove(struct i2c_client *client)
 
 	if (priv->poc_enabled)
 		regulator_disable(priv->regulator);
-	regulator_put(priv->regulator);
 
 	gpiod_set_value_cansleep(priv->gpiod_pwdn, 0);