projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21b5cf3
)
mtd: rawnand: Add a helper to check supported operations
author
Miquel Raynal
<miquel.raynal@bootlin.com>
Thu, 7 May 2020 10:52:35 +0000
(12:52 +0200)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Mon, 11 May 2020 07:51:42 +0000
(09:51 +0200)
Let's use a helper to clearly check if an operation is supported or not.
Return -ENOTSUPP when ->exec_op() is not implemented as we cannot know.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link:
https://lore.kernel.org/linux-mtd/20200507105241.14299-8-miquel.raynal@bootlin.com
drivers/mtd/nand/raw/internals.h
patch
|
blob
|
history
diff --git
a/drivers/mtd/nand/raw/internals.h
b/drivers/mtd/nand/raw/internals.h
index bca9b3424646aeac94f565f3cf7b19315f7ee718..03866b0aadea7071c1d3c5b23f743cc03e882845 100644
(file)
--- a/
drivers/mtd/nand/raw/internals.h
+++ b/
drivers/mtd/nand/raw/internals.h
@@
-109,6
+109,15
@@
static inline bool nand_has_exec_op(struct nand_chip *chip)
return true;
}
+static inline int nand_check_op(struct nand_chip *chip,
+ const struct nand_operation *op)
+{
+ if (!nand_has_exec_op(chip))
+ return 0;
+
+ return chip->controller->ops->exec_op(chip, op, true);
+}
+
static inline int nand_exec_op(struct nand_chip *chip,
const struct nand_operation *op)
{