From: mpa@pengutronix.de (Markus Pargmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 2/2] usb: musb: dsps, use devm_kzalloc
Date: Fri, 17 Jan 2014 10:22:36 +0100 [thread overview]
Message-ID: <1389950556-6453-3-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1389950556-6453-1-git-send-email-mpa@pengutronix.de>
Replace kzalloc by devm_kzalloc and remove the kfree() calls.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
drivers/usb/musb/musb_dsps.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index d0a97d6..6cae0c8 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -668,7 +668,7 @@ static int dsps_probe(struct platform_device *pdev)
wrp = match->data;
/* allocate glue */
- glue = kzalloc(sizeof(*glue), GFP_KERNEL);
+ glue = devm_kzalloc(&pdev->dev, sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&pdev->dev, "unable to allocate glue memory\n");
return -ENOMEM;
@@ -696,7 +696,6 @@ err3:
pm_runtime_put(&pdev->dev);
err2:
pm_runtime_disable(&pdev->dev);
- kfree(glue);
return ret;
}
@@ -709,7 +708,6 @@ static int dsps_remove(struct platform_device *pdev)
/* disable usbss clocks */
pm_runtime_put(&pdev->dev);
pm_runtime_disable(&pdev->dev);
- kfree(glue);
debugfs_remove_recursive(glue->dbgfs_root);
--
1.8.5.2
next prev parent reply other threads:[~2014-01-17 9:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-17 9:22 [PATCH v4 0/2] usb: musb dsps updates Markus Pargmann
2014-01-17 9:22 ` [PATCH v4 1/2] usb: musb: dsps, debugfs files Markus Pargmann
2014-02-18 16:20 ` Felipe Balbi
2014-02-18 16:59 ` Greg KH
2014-02-18 17:03 ` Felipe Balbi
2014-02-18 17:30 ` Greg KH
2014-02-18 17:50 ` Felipe Balbi
2014-01-17 9:22 ` Markus Pargmann [this message]
2014-02-16 22:03 ` [PATCH v4 0/2] usb: musb dsps updates Markus Pargmann
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=1389950556-6453-3-git-send-email-mpa@pengutronix.de \
--to=mpa@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).