Skip to contentSkip to conversation

mfd: rc5t583: Convert to devm_regmap_init_i2c()

PATCH In review Axel Lin 5 participants 9 messages Apr 25, 2012 – May 9, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/5 mfd: rc5t583: Convert to devm_regmap_init_i2c()

---
 drivers/mfd/rc5t583.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
drivers/mfd/rc5t583.c +2 -5
index 1cb4c35..cdc1df7 100644
@@ -268,7 +268,7 @@ static int __devinit rc5t583_i2c_probe(struct i2c_client *i2c,
 	rc5t583->dev = &i2c->dev;
 	i2c_set_clientdata(i2c, rc5t583);
 
-	rc5t583->regmap = regmap_init_i2c(i2c, &rc5t583_regmap_config);
+	rc5t583->regmap = devm_regmap_init_i2c(i2c, &rc5t583_regmap_config);
 	if (IS_ERR(rc5t583->regmap)) {
 		ret = PTR_ERR(rc5t583->regmap);
 		dev_err(&i2c->dev, "regmap initialization failed: %d\n", ret);
@@ -277,7 +277,7 @@ static int __devinit rc5t583_i2c_probe(struct i2c_client *i2c,
 
 	ret = rc5t583_clear_ext_power_req(rc5t583, pdata);
 	if (ret < 0)
-		goto err_irq_init;
+		return ret;
 
 	if (i2c->irq) {
 		ret = rc5t583_irq_init(rc5t583, i2c->irq, pdata->irq_base);
@@ -300,8 +300,6 @@ static int __devinit rc5t583_i2c_probe(struct i2c_client *i2c,
 err_add_devs:
 	if (irq_init_success)
 		rc5t583_irq_exit(rc5t583);
-err_irq_init:
-	regmap_exit(rc5t583->regmap);
 	return ret;
 }
 
@@ -311,7 +309,6 @@ static int  __devexit rc5t583_i2c_remove(struct i2c_client *i2c)
 
 	mfd_remove_devices(rc5t583->dev);
 	rc5t583_irq_exit(rc5t583);
-	regmap_exit(rc5t583->regmap);
 	return 0;
 }
 
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 2/5 mfd: s5m-core: Convert to devm_regmap_init_i2c()

---
 drivers/mfd/s5m-core.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
drivers/mfd/s5m-core.c +2 -4
index 48949d9..dd17030 100644
@@ -114,12 +114,12 @@ static int s5m87xx_i2c_probe(struct i2c_client *i2c,
 		s5m87xx->wakeup = pdata->wakeup;
 	}
 
-	s5m87xx->regmap = regmap_init_i2c(i2c, &s5m_regmap_config);
+	s5m87xx->regmap = devm_regmap_init_i2c(i2c, &s5m_regmap_config);
 	if (IS_ERR(s5m87xx->regmap)) {
 		ret = PTR_ERR(s5m87xx->regmap);
 		dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
 			ret);
-		goto err;
+		return ret;
 	}
 
 	s5m87xx->rtc = i2c_new_dummy(i2c->adapter, RTC_I2C_ADDR);
@@ -159,7 +159,6 @@ err:
 	mfd_remove_devices(s5m87xx->dev);
 	s5m_irq_exit(s5m87xx);
 	i2c_unregister_device(s5m87xx->rtc);
-	regmap_exit(s5m87xx->regmap);
 	return ret;
 }
 
@@ -170,7 +169,6 @@ static int s5m87xx_i2c_remove(struct i2c_client *i2c)
 	mfd_remove_devices(s5m87xx->dev);
 	s5m_irq_exit(s5m87xx);
 	i2c_unregister_device(s5m87xx->rtc);
-	regmap_exit(s5m87xx->regmap);
 	return 0;
 }
 
Signature · 1 line
1.7.5.4
author
#2 lore raw

PATCH 3/5 mfd: tps65090: Convert to devm_regmap_init_i2c()

In reply to Axel Lin
---
 drivers/mfd/tps65090.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
drivers/mfd/tps65090.c +3 -7
index da821d9..3e12bba 100644
@@ -283,8 +283,8 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
 		}
 	}
 
-	tps65090->rmap = regmap_init_i2c(tps65090->client,
-		&tps65090_regmap_config);
+	tps65090->rmap = devm_regmap_init_i2c(tps65090->client,
+					      &tps65090_regmap_config);
 	if (IS_ERR(tps65090->rmap)) {
 		ret = PTR_ERR(tps65090->rmap);
 		dev_err(&client->dev, "regmap_init failed with err: %d\n", ret);
@@ -296,14 +296,11 @@ static int __devinit tps65090_i2c_probe(struct i2c_client *client,
 	if (ret) {
 		dev_err(&client->dev, "add mfd devices failed with err: %d\n",
 			ret);
-		goto err_regmap_exit;
+		goto err_irq_exit;
 	}
 
 	return 0;
 
-err_regmap_exit:
-	regmap_exit(tps65090->rmap);
-
 err_irq_exit:
 	if (client->irq)
 		free_irq(client->irq, tps65090);
@@ -316,7 +313,6 @@ static int __devexit tps65090_i2c_remove(struct i2c_client *client)
 	struct tps65090 *tps65090 = i2c_get_clientdata(client);
 
 	mfd_remove_devices(tps65090->dev);
-	regmap_exit(tps65090->rmap);
 	if (client->irq)
 		free_irq(client->irq, tps65090);
 
Signature · 1 line
1.7.5.4
#3 lore raw

RE: [PATCH 3/5] mfd: tps65090: Convert to devm_regmap_init_i2c()

Thanks for the patch.
Acked by: Venu Byravarasu<[email protected]>

Quoted 55 lines

-----Original Message-----
From: Axel Lin [mailto:[email protected]]
Sent: Wednesday, April 25, 2012 7:35 AM
To: [email protected]
Cc: Samuel Ortiz; Venu Byravarasu
Subject: [PATCH 3/5] mfd: tps65090: Convert to devm_regmap_init_i2c()

---
 drivers/mfd/tps65090.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
drivers/mfd/tps65090.c +2 -2
index da821d9..3e12bba 100644
@@ -283,8 +283,8 @@ static int __devinit tps65090_i2c_probe(struct
 i2c_client *client,
 		}
 	}
 
-	tps65090->rmap = regmap_init_i2c(tps65090->client,
-		&tps65090_regmap_config);
+	tps65090->rmap = devm_regmap_init_i2c(tps65090->client,
+					      &tps65090_regmap_config);
 	if (IS_ERR(tps65090->rmap)) {
 		ret = PTR_ERR(tps65090->rmap);
drivers/mfd/tps65090.c +1 -4
 		dev_err(&client->dev, "regmap_init failed with err: %d\n", ret);
@@ -296,14 +296,11 @@ static int __devinit tps65090_i2c_probe(struct
 i2c_client *client,
 	if (ret) {
 		dev_err(&client->dev, "add mfd devices failed with err: %d\n",
 			ret);
-		goto err_regmap_exit;
+		goto err_irq_exit;
 	}
 
 	return 0;
 
-err_regmap_exit:
-	regmap_exit(tps65090->rmap);
-
 err_irq_exit:
 	if (client->irq)
drivers/mfd/tps65090.c +0 -2
 		free_irq(client->irq, tps65090);
@@ -316,7 +313,6 @@ static int __devexit tps65090_i2c_remove(struct
 i2c_client *client)
 	struct tps65090 *tps65090 = i2c_get_clientdata(client);
 
 	mfd_remove_devices(tps65090->dev);
-	regmap_exit(tps65090->rmap);
 	if (client->irq)
 		free_irq(client->irq, tps65090);
 
--
Quoted 3 lines

1.7.5.4

���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

author
#4 lore raw

PATCH 4/5 mfd: tps65217: Convert to devm_regmap_init_i2c()

In reply to Axel Lin
---
 drivers/mfd/tps65217.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)
drivers/mfd/tps65217.c +4 -11
index f7d854e..c064c0a 100644
@@ -150,7 +150,7 @@ static int __devinit tps65217_probe(struct i2c_client *client,
 		return -ENOMEM;
 
 	tps->pdata = pdata;
-	tps->regmap = regmap_init_i2c(client, &tps65217_regmap_config);
+	tps->regmap = devm_regmap_init_i2c(client, &tps65217_regmap_config);
 	if (IS_ERR(tps->regmap)) {
 		ret = PTR_ERR(tps->regmap);
 		dev_err(tps->dev, "Failed to allocate register map: %d\n",
@@ -163,9 +163,9 @@ static int __devinit tps65217_probe(struct i2c_client *client,
 
 	ret = tps65217_reg_read(tps, TPS65217_REG_CHIPID, &version);
 	if (ret < 0) {
-		dev_err(tps->dev, "Failed to read revision"
-					" register: %d\n", ret);
-		goto err_regmap;
+		dev_err(tps->dev, "Failed to read revision register: %d\n",
+			ret);
+		return ret;
 	}
 
 	dev_info(tps->dev, "TPS65217 ID %#x version 1.%d\n",
@@ -190,11 +190,6 @@ static int __devinit tps65217_probe(struct i2c_client *client,
 	}
 
 	return 0;
-
-err_regmap:
-	regmap_exit(tps->regmap);
-
-	return ret;
 }
 
 static int __devexit tps65217_remove(struct i2c_client *client)
@@ -205,8 +200,6 @@ static int __devexit tps65217_remove(struct i2c_client *client)
 	for (i = 0; i < TPS65217_NUM_REGULATOR; i++)
 		platform_device_unregister(tps->regulator_pdev[i]);
 
-	regmap_exit(tps->regmap);
-
 	return 0;
 }
 
Signature · 1 line
1.7.5.4
author
#5 lore raw

PATCH 5/5 mfd: twl6040-core: Convert to devm_regmap_init_i2c()

In reply to Axel Lin
---
 drivers/mfd/twl6040-core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/mfd/twl6040-core.c +1 -3
index 2d6beda..493f4a6 100644
@@ -524,7 +524,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
 		goto err;
 	}
 
-	twl6040->regmap = regmap_init_i2c(client, &twl6040_regmap_config);
+	twl6040->regmap = devm_regmap_init_i2c(client, &twl6040_regmap_config);
 	if (IS_ERR(twl6040->regmap)) {
 		ret = PTR_ERR(twl6040->regmap);
 		goto err;
@@ -623,7 +623,6 @@ gpio2_err:
 		gpio_free(twl6040->audpwron);
 gpio1_err:
 	i2c_set_clientdata(client, NULL);
-	regmap_exit(twl6040->regmap);
 err:
 	return ret;
 }
@@ -643,7 +642,6 @@ static int __devexit twl6040_remove(struct i2c_client *client)
 
 	mfd_remove_devices(&client->dev);
 	i2c_set_clientdata(client, NULL);
-	regmap_exit(twl6040->regmap);
 
 	return 0;
 }
Signature · 1 line
1.7.5.4
Acked-by on v1 5/5
#6 lore raw

Re: [PATCH 5/5] mfd: twl6040-core: Convert to devm_regmap_init_i2c()

Quoted 27 lines · Axel Lin
---
 drivers/mfd/twl6040-core.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/mfd/twl6040-core.c +1 -2
index 2d6beda..493f4a6 100644
@@ -524,7 +524,7 @@ static int __devinit twl6040_probe(struct i2c_client *client,
 		goto err;
 	}
 
-	twl6040->regmap = regmap_init_i2c(client, &twl6040_regmap_config);
+	twl6040->regmap = devm_regmap_init_i2c(client, &twl6040_regmap_config);
 	if (IS_ERR(twl6040->regmap)) {
 		ret = PTR_ERR(twl6040->regmap);
 		goto err;
@@ -623,7 +623,6 @@ gpio2_err:
 		gpio_free(twl6040->audpwron);
 gpio1_err:
 	i2c_set_clientdata(client, NULL);
-	regmap_exit(twl6040->regmap);
 err:
 	return ret;
 }

drivers/mfd/twl6040-core.c static int __devexit twl6040_remove(struct i2c_client *client) · line 647

Quoted 7 lines
drivers/mfd/twl6040-core.c +0 -1
@@ -643,7 +642,6 @@ static int __devexit twl6040_remove(struct i2c_client *client)
 
 	mfd_remove_devices(&client->dev);
 	i2c_set_clientdata(client, NULL);
-	regmap_exit(twl6040->regmap);
 
 	return 0;
 }
#8 lore raw
In reply to Axel Lin

Hi Axel,

Quoted 4 lines · Axel Lin
---
 drivers/mfd/rc5t583.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

All 5 patches applied, thanks.

Cheers,
Samuel.

Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/