Skip to contentSkip to conversation

ASoC: cs42l52: Convert to use devm_gpio_request_one

PATCH Applied Axel Lin 2 participants 4 messages Apr 8, 2014 – Apr 18, 2014

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 ASoC: cs42l52: Convert to use devm_gpio_request_one

Current code missed a gpio_free() call in cs42l52_i2c_remove(). Convert to use devm_gpio_request_one() to fix it.

---
 sound/soc/codecs/cs42l52.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/cs42l52.c +4 -2
index 460d355..2213a03 100644
@@ -1229,8 +1229,10 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client,
 	}
 
 	if (cs42l52->pdata.reset_gpio) {
-		ret = gpio_request_one(cs42l52->pdata.reset_gpio,
-				       GPIOF_OUT_INIT_HIGH, "CS42L52 /RST");
+		ret = devm_gpio_request_one(&i2c_client->dev,
+					    cs42l52->pdata.reset_gpio,
+					    GPIOF_OUT_INIT_HIGH,
+					    "CS42L52 /RST");
 		if (ret < 0) {
 			dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n",
 				cs42l52->pdata.reset_gpio, ret);
Signature · 1 line
1.8.3.2
author
#1 lore raw

PATCH 2/2 ASoC: cs42l73: Convert to use devm_gpio_request_one

Current code missed a gpio_free() call in cs42l73_i2c_remove(). Convert to use devm_gpio_request_one() to fix it.

---
 sound/soc/codecs/cs42l73.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/codecs/cs42l73.c +4 -2
index 0ee60a1..ae37179 100644
@@ -1443,8 +1443,10 @@ static int cs42l73_i2c_probe(struct i2c_client *i2c_client,
 	i2c_set_clientdata(i2c_client, cs42l73);
 
 	if (cs42l73->pdata.reset_gpio) {
-		ret = gpio_request_one(cs42l73->pdata.reset_gpio,
-				       GPIOF_OUT_INIT_HIGH, "CS42L73 /RST");
+		ret = devm_gpio_request_one(&i2c_client->dev,
+					    cs42l73->pdata.reset_gpio,
+					    GPIOF_OUT_INIT_HIGH,
+					    "CS42L73 /RST");
 		if (ret < 0) {
 			dev_err(&i2c_client->dev, "Failed to request /RST %d: %d\n",
 				cs42l73->pdata.reset_gpio, ret);
Signature · 1 line
1.8.3.2
maintainer Applied
#3 lore raw
In reply to Axel Lin
Quoted 2 lines · Axel Lin

Current code missed a gpio_free() call in cs42l52_i2c_remove(). Convert to use devm_gpio_request_one() to fix it.

Applied, thanks.

maintainer Applied
#2 lore raw

Re: [PATCH 2/2] ASoC: cs42l73: Convert to use devm_gpio_request_one

In reply to Axel Lin
Quoted 2 lines · Axel Lin

Current code missed a gpio_free() call in cs42l73_i2c_remove(). Convert to use devm_gpio_request_one() to fix it.

Applied, thanks.