public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Anton Vasilyev <vasilyev@ispras.ru>
To: Boris Brezillon <boris.brezillon@free-electrons.com>
Cc: Anton Vasilyev <vasilyev@ispras.ru>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	Cyrille Pitchen <cyrille.pitchen@wedev4u.fr>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	ldv-project@linuxtesting.org
Subject: [PATCH v1] mtd: plat-ram: use release_mem_region instead of release_resource
Date: Tue, 15 Aug 2017 15:21:34 +0300	[thread overview]
Message-ID: <1502799694-669-1-git-send-email-vasilyev@ispras.ru> (raw)

Use api pair of request_mem_region and release_mem_region
instead of release_resource.

Found by Linux Driver Verification project (linuxtesting.

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
---
v1: Fix commit based on Boris Brezillon review
---
 drivers/mtd/maps/plat-ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 5157289..90bc87f 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -100,8 +100,8 @@ static int platram_remove(struct platform_device *pdev)
 	/* release resources */
 
 	if (info->area) {
-		release_resource(info->area);
-		kfree(info->area);
+		release_mem_region(info->area->start,
+				resource_size(info->area));
 	}
 
 	if (info->map.virt != NULL)
-- 
2.7.4

             reply	other threads:[~2017-08-15 12:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 12:21 Anton Vasilyev [this message]
2017-08-15 17:13 ` [PATCH v1] mtd: plat-ram: use release_mem_region instead of release_resource Boris Brezillon

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=1502799694-669-1-git-send-email-vasilyev@ispras.ru \
    --to=vasilyev@ispras.ru \
    --cc=boris.brezillon@free-electrons.com \
    --cc=computersforpeace@gmail.com \
    --cc=cyrille.pitchen@wedev4u.fr \
    --cc=dwmw2@infradead.org \
    --cc=ldv-project@linuxtesting.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=richard@nod.at \
    /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