lkml.org 
[lkml]   [2021]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 4/4] mtd: mtdconcat: add suspend lock handling
Date
Use MTD hooks to control suspend/resume of MTD devices.

Fixes: 013e6292aaf5 ("mtd: rawnand: Simplify the locking")
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Sean Nyekjaer <sean@geanix.com>
---
drivers/mtd/mtdconcat.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index f685a581df48..1ec36890118f 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -566,9 +566,11 @@ static int concat_suspend(struct mtd_info *mtd)

for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->subdev[i];
- if ((rc = mtd_suspend(subdev)) < 0)
+ rc = subdev->_suspend ? subdev->_suspend(subdev) : 0;
+ if (rc < 0)
return rc;
}
+
return rc;
}

@@ -579,7 +581,8 @@ static void concat_resume(struct mtd_info *mtd)

for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->subdev[i];
- mtd_resume(subdev);
+ if (subdev->_resume)
+ subdev->_resume(subdev);
}
}

--
2.33.0
\
 
 \ /
  Last update: 2021-10-20 10:46    [W:0.073 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site