mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Himangi Saraogi <himangi774@gmail.com>
To: Ashutosh Dixit <ashutosh.dixit@intel.com>,
	Dasaratharaman Chandramouli 
	<dasaratharaman.chandramouli@intel.com>,
	Sudeep Dutt <sudeep.dutt@intel.com>,
	linux-kernel@vger.kernel.org
Cc: julia.lawall@lip6.fr
Subject: [PATCH] misc: mic: Introduce the managed version of ioremap
Date: Mon, 2 Jun 2014 00:24:53 +0530	[thread overview]
Message-ID: <20140601185452.GA21438@himangi-Dell> (raw)

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.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
I wonder if mic_card_map and mic_card_unmap can be used on the same data
as the devm_ioremap in the probe function. If yes, can I devmify them as well,
in which case mic_card_unmap will not be required.

 drivers/misc/mic/card/mic_x100.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/misc/mic/card/mic_x100.c b/drivers/misc/mic/card/mic_x100.c
index 2868945..5f26b17 100644
--- a/drivers/misc/mic/card/mic_x100.c
+++ b/drivers/misc/mic/card/mic_x100.c
@@ -159,7 +159,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;
@@ -169,22 +170,17 @@ static int __init mic_probe(struct platform_device *pdev)
 	rc = mic_driver_init(mdrv);
 	if (rc) {
 		dev_err(&pdev->dev, "mic_driver_init failed rc %d\n", rc);
-		goto iounmap;
+		goto done;
 	}
 done:
 	return rc;
-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);
-	iounmap(mdev->mmio.va);
 	return 0;
 }
 
-- 
1.9.1


             reply	other threads:[~2014-06-01 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-01 18:54 Himangi Saraogi [this message]
2014-06-02 16:30 ` Sudeep Dutt

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=20140601185452.GA21438@himangi-Dell \
    --to=himangi774@gmail.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=dasaratharaman.chandramouli@intel.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.dutt@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®