mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-22 16:57:40 +07:00
mtd: rawnand: Add a helper to check supported operations
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
This commit is contained in:
parent
21b5cf3f64
commit
930370253e
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user