lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6e5bccd7e442687715bf1faf6a7c7a2dcb8ce75f.1405370827.git.sudeep.dutt@intel.com>
Date:	Mon, 14 Jul 2014 14:23:51 -0700
From:	Sudeep Dutt <sudeep.dutt@...el.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:	Dan Williams <dan.j.williams@...el.com>,
	Siva Yerramreddy <yshivakrishna@...il.com>,
	Ashutosh Dixit <ashutosh.dixit@...el.com>,
	Nikhil Rao <nikhil.rao@...el.com>,
	Sudeep Dutt <sudeep.dutt@...el.com>,
	Paul Bolle <pebolle@...cali.nl>,
	Himangi Saraogi <himangi774@...il.com>,
	linux-kernel@...r.kernel.org, dmaengine@...r.kernel.org
Subject: [PATCH char-misc-next 1/2] misc: mic: Introduce the managed version of ioremap

From: Himangi Saraogi <himangi774@...il.com>

This patch moves data allocated using ioremap to managed data
allocated using devm_ioremap and cleans now unnecessary
iounmaps in probe and remove functions. Also the unnecessary
label iounmap is done away with.

Link: https://lkml.org/lkml/2014/6/1/191
Tested-by: Sudeep Dutt <sudeep.dutt@...el.com>
Signed-off-by: Himangi Saraogi <himangi774@...il.com>
---
 drivers/misc/mic/card/mic_x100.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/mic/card/mic_x100.c b/drivers/misc/mic/card/mic_x100.c
index 55c9465..9d57545 100644
--- a/drivers/misc/mic/card/mic_x100.c
+++ b/drivers/misc/mic/card/mic_x100.c
@@ -200,7 +200,8 @@ static int __init mic_probe(struct platform_device *pdev)
 
 	mdev->mmio.pa = MIC_X100_MMIO_BASE;
 	mdev->mmio.len = MIC_X100_MMIO_LEN;
-	mdev->mmio.va = ioremap(MIC_X100_MMIO_BASE, MIC_X100_MMIO_LEN);
+	mdev->mmio.va = devm_ioremap(&pdev->dev, MIC_X100_MMIO_BASE,
+				     MIC_X100_MMIO_LEN);
 	if (!mdev->mmio.va) {
 		dev_err(&pdev->dev, "Cannot remap MMIO BAR\n");
 		rc = -EIO;
@@ -214,7 +215,7 @@ static int __init mic_probe(struct platform_device *pdev)
 	if (IS_ERR(mdrv->dma_mbdev)) {
 		rc = PTR_ERR(mdrv->dma_mbdev);
 		dev_err(&pdev->dev, "mbus_add_device failed rc %d\n", rc);
-		goto iounmap;
+		goto done;
 	}
 	rc = mic_driver_init(mdrv);
 	if (rc) {
@@ -225,19 +226,15 @@ done:
 	return rc;
 remove_dma:
 	mbus_unregister_device(mdrv->dma_mbdev);
-iounmap:
-	iounmap(mdev->mmio.va);
 	return rc;
 }
 
 static int mic_remove(struct platform_device *pdev)
 {
 	struct mic_driver *mdrv = &g_drv;
-	struct mic_device *mdev = &mdrv->mdev;
 
 	mic_driver_uninit(mdrv);
 	mbus_unregister_device(mdrv->dma_mbdev);
-	iounmap(mdev->mmio.va);
 	return 0;
 }
 
-- 
1.8.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ