* [PATCH] mailbox-omap1 : Use devm_ functions
@ 2014-07-01 18:45 Himangi Saraogi
0 siblings, 0 replies; only message in thread
From: Himangi Saraogi @ 2014-07-01 18:45 UTC (permalink / raw)
To: linux-kernel; +Cc: julia.lawall
This patch intoduces the use of devm_ioremap, does away with the ret
variable. The calls to iounmap in the probe and remove functions and no
longer needed and hence removed.
Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
drivers/mailbox/mailbox-omap1.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/mailbox/mailbox-omap1.c b/drivers/mailbox/mailbox-omap1.c
index 9001b76..508024f 100644
--- a/drivers/mailbox/mailbox-omap1.c
+++ b/drivers/mailbox/mailbox-omap1.c
@@ -146,7 +146,6 @@ static struct omap_mbox *omap1_mboxes[] = { &mbox_dsp_info, NULL };
static int omap1_mbox_probe(struct platform_device *pdev)
{
struct resource *mem;
- int ret;
struct omap_mbox **list;
list = omap1_mboxes;
@@ -156,23 +155,16 @@ static int omap1_mbox_probe(struct platform_device *pdev)
if (!mem)
return -ENOENT;
- mbox_base = ioremap(mem->start, resource_size(mem));
+ mbox_base = devm_ioremap(&pdev->dev, mem->start, resource_size(mem));
if (!mbox_base)
return -ENOMEM;
- ret = omap_mbox_register(&pdev->dev, list);
- if (ret) {
- iounmap(mbox_base);
- return ret;
- }
-
- return 0;
+ return omap_mbox_register(&pdev->dev, list);
}
static int omap1_mbox_remove(struct platform_device *pdev)
{
omap_mbox_unregister();
- iounmap(mbox_base);
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-01 18:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-01 18:45 [PATCH] mailbox-omap1 : Use devm_ functions Himangi Saraogi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox