mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 01/11] mfd: 88pm860x: drop devm_kfree of devm_kzalloc'd data
@ 2013-02-20  6:09 Jingoo Han
  2013-02-20  6:10 ` [PATCH 02/11] mfd: lm3533: use devm_gpio_request_one() Jingoo Han
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Jingoo Han @ 2013-02-20  6:09 UTC (permalink / raw)
  To: 'Samuel Ortiz'; +Cc: linux-kernel, 'Jingoo Han'

devm_kfree() allocates memory that is released when a driver detaches.
Thus, there is no reason to explicitly call devm_kfree() in probe or remove
functions.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/mfd/88pm860x-core.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index 893fc1b..31ca555 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -1144,17 +1144,15 @@ static int pm860x_probe(struct i2c_client *client,
 			return -ENOMEM;
 		ret = pm860x_dt_init(node, &client->dev, pdata);
 		if (ret)
-			goto err;
+			return ret;
 	} else if (!pdata) {
 		pr_info("No platform data in %s!\n", __func__);
 		return -EINVAL;
 	}
 
 	chip = kzalloc(sizeof(struct pm860x_chip), GFP_KERNEL);
-	if (chip == NULL) {
-		ret = -ENOMEM;
-		goto err;
-	}
+	if (chip == NULL)
+		return -ENOMEM;
 
 	chip->id = verify_addr(client);
 	chip->regmap = regmap_init_i2c(client, &pm860x_regmap_config);
@@ -1194,10 +1192,6 @@ static int pm860x_probe(struct i2c_client *client,
 
 	pm860x_device_init(chip, pdata);
 	return 0;
-err:
-	if (node)
-		devm_kfree(&client->dev, pdata);
-	return ret;
 }
 
 static int pm860x_remove(struct i2c_client *client)
-- 
1.7.2.5



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2013-02-20  8:36 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-20  6:09 [PATCH 01/11] mfd: 88pm860x: drop devm_kfree of devm_kzalloc'd data Jingoo Han
2013-02-20  6:10 ` [PATCH 02/11] mfd: lm3533: use devm_gpio_request_one() Jingoo Han
2013-02-20  6:10 ` [PATCH 03/11] mfd: aat2870: use devm_gpio_request_one() and devm_kzalloc() Jingoo Han
2013-02-20  6:11 ` [PATCH 04/11] mfd: intel_msic: use devm_gpio_request_one() Jingoo Han
2013-02-20  6:11 ` [PATCH 05/11] mfd: twl6040: use devm_gpio_request_one() and devm_request_threaded_irq() Jingoo Han
2013-02-20  7:37   ` Dmitry Torokhov
2013-02-20  8:09     ` Jingoo Han
2013-02-20  6:12 ` [PATCH 06/11] mfd: omap-usb-host: use devm_gpio_request_one() Jingoo Han
2013-02-20  6:12 ` [PATCH 07/11] mfd: menelaus: use devm_request_irq() and devm_kzalloc() Jingoo Han
2013-02-20  7:30   ` Dmitry Torokhov
2013-02-20  8:05     ` Jingoo Han
2013-02-20  8:10       ` Dmitry Torokhov
2013-02-20  8:17         ` Jingoo Han
2013-02-20  8:36           ` Dmitry Torokhov
2013-02-20  6:13 ` [PATCH 08/11] mfd: ezx-pcap: " Jingoo Han
2013-02-20  7:33   ` Dmitry Torokhov
2013-02-20  8:06     ` Jingoo Han
2013-02-20  6:13 ` [PATCH 09/11] mfd: da903x: " Jingoo Han
2013-02-20  6:14 ` [PATCH 10/11] mfd: tps65010: " Jingoo Han
2013-02-20  7:35   ` Dmitry Torokhov
2013-02-20  8:07     ` Jingoo Han
2013-02-20  6:14 ` [PATCH 11/11] mfd: tc3589x: " Jingoo Han

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®