projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb45430
)
mtd: char: Drop mtd_mutex usage from mtdchar_open()
author
Alexander Sverdlin
<alexander.sverdlin@nokia.com>
Wed, 17 Feb 2021 21:18:44 +0000
(22:18 +0100)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 11 Mar 2021 08:37:49 +0000
(09:37 +0100)
It looks unnecessary in the function, remove it from the function
having in mind to remove it completely.
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link:
https://lore.kernel.org/linux-mtd/20210217211845.43364-1-alexander.sverdlin@nokia.com
drivers/mtd/mtdchar.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/mtdchar.c
b/drivers/mtd/mtdchar.c
index 323035d4f2d019c80e20fd65b5eeedd2ddb62675..f31390d186ca521d50059f9b2ac6a1f77735b1de 100644
(file)
--- a/
drivers/mtd/mtdchar.c
+++ b/
drivers/mtd/mtdchar.c
@@
-58,13
+58,10
@@
static int mtdchar_open(struct inode *inode, struct file *file)
if ((file->f_mode & FMODE_WRITE) && (minor & 1))
return -EACCES;
- mutex_lock(&mtd_mutex);
mtd = get_mtd_device(NULL, devnum);
- if (IS_ERR(mtd)) {
- ret = PTR_ERR(mtd);
- goto out;
- }
+ if (IS_ERR(mtd))
+ return PTR_ERR(mtd);
if (mtd->type == MTD_ABSENT) {
ret = -ENODEV;
@@
-84,13
+81,10
@@
static int mtdchar_open(struct inode *inode, struct file *file)
}
mfi->mtd = mtd;
file->private_data = mfi;
- mutex_unlock(&mtd_mutex);
return 0;
out1:
put_mtd_device(mtd);
-out:
- mutex_unlock(&mtd_mutex);
return ret;
} /* mtdchar_open */