From: Jingoo Han <jg1.han@samsung.com>
To: "'Samuel Ortiz'" <sameo@linux.intel.com>
Cc: linux-kernel@vger.kernel.org, "'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH V2 1/9] mfd: 88pm860x: drop devm_kfree of devm_kzalloc'd data
Date: Wed, 20 Feb 2013 18:27:21 +0900 [thread overview]
Message-ID: <000f01ce0f4c$7c1d01d0$74570570$%han@samsung.com> (raw)
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>
---
No changes since v1:
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
next reply other threads:[~2013-02-20 9:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-20 9:27 Jingoo Han [this message]
2013-02-20 9:28 ` [PATCH V2 2/9] mfd: lm3533: use devm_gpio_request_one() Jingoo Han
2013-02-20 9:28 ` [PATCH V2 3/9] mfd: intel_msic: " Jingoo Han
2013-02-20 9:29 ` [PATCH V2 4/9] mfd: omap-usb-host: " Jingoo Han
2013-02-20 9:29 ` [PATCH V2 5/9] mfd: aat2870: use use devm_*() functions Jingoo Han
2013-02-20 9:30 ` [PATCH V2 6/9] mfd: twl6040: " Jingoo Han
2013-02-20 9:30 ` [PATCH V2 7/9] mfd: ezx-pcap: " Jingoo Han
2013-02-20 9:31 ` [PATCH V2 8/9] mfd: da903x: " Jingoo Han
2013-02-20 9:31 ` [PATCH V2 9/9] mfd: tc3589x: " Jingoo Han
2013-04-08 15:26 ` [PATCH V2 1/9] mfd: 88pm860x: drop devm_kfree of devm_kzalloc'd data Samuel Ortiz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='000f01ce0f4c$7c1d01d0$74570570$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®