From: Amitoj Kaur Chawla <amitoj1606@gmail.com>
To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: [PATCH 1/2] ARM: pxa: ssp: Drop unnecessary freeing functions
Date: Mon, 13 Jun 2016 20:23:07 +0530 [thread overview]
Message-ID: <da474c948aefa6ff7ef13f8e1250055d572ffbac.1465827542.git.amitoj1606@gmail.com> (raw)
In-Reply-To: <cover.1465827542.git.amitoj1606@gmail.com>
Drop clk_put, kfree, release_mem_region and iounmap for
devm_ allocated data in the remove function of the driver.
Some of these changes were made with the help of the following
Coccinelle semantic patch:
@r@
expression x;
@@
(
x = devm_kzalloc(...)
|
x = devm_request_irq(...)
|
x = devm_ioremap(...)
|
x = devm_ioremap_nocache(...)
)
@@
expression r.x;
@@
(
* kfree(x)
|
* free_irq(x)
|
* iounmap(x)
)
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
arch/arm/plat-pxa/ssp.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/arch/arm/plat-pxa/ssp.c b/arch/arm/plat-pxa/ssp.c
index ba13f79..97bd43c 100644
--- a/arch/arm/plat-pxa/ssp.c
+++ b/arch/arm/plat-pxa/ssp.c
@@ -230,25 +230,16 @@ static int pxa_ssp_probe(struct platform_device *pdev)
static int pxa_ssp_remove(struct platform_device *pdev)
{
- struct resource *res;
struct ssp_device *ssp;
ssp = platform_get_drvdata(pdev);
if (ssp == NULL)
return -ENODEV;
- iounmap(ssp->mmio_base);
-
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- release_mem_region(res->start, resource_size(res));
-
- clk_put(ssp->clk);
-
mutex_lock(&ssp_lock);
list_del(&ssp->node);
mutex_unlock(&ssp_lock);
- kfree(ssp);
return 0;
}
--
1.9.1
next prev parent reply other threads:[~2016-06-13 14:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-13 14:53 [PATCH 0/2] ARM: pxa: ssp: Clean up probe and remove functions Amitoj Kaur Chawla
2016-06-13 14:53 ` Amitoj Kaur Chawla [this message]
2016-06-13 14:53 ` [PATCH 2/2] ARM: pxa: ssp: Switch to devm_ioremap_resource Amitoj Kaur Chawla
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=da474c948aefa6ff7ef13f8e1250055d572ffbac.1465827542.git.amitoj1606@gmail.com \
--to=amitoj1606@gmail.com \
--cc=julia.lawall@lip6.fr \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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®