lkml.org 
[lkml]   [2017]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mtd: plat-ram: use release_mem_region instead of release_resource
Date
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>
---
drivers/mtd/maps/plat-ram.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 5157289..baaf146 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -82,6 +82,7 @@ static inline void platram_setrw(struct platram_info *info, int to)
static int platram_remove(struct platform_device *pdev)
{
struct platram_info *info = to_platram_info(pdev);
+ resource_size_t res_size;

dev_dbg(&pdev->dev, "removing device\n");

@@ -100,8 +101,8 @@ static int platram_remove(struct platform_device *pdev)
/* release resources */

if (info->area) {
- release_resource(info->area);
- kfree(info->area);
+ res_size = resource_size(info->area)
+ release_mem_region(info->area->start, res_size);
}

if (info->map.virt != NULL)
--
2.7.4
\
 
 \ /
  Last update: 2017-08-11 14:56    [W:0.038 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site