From: Boris Brezillon <boris.brezillon@collabora.com>
To: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Michal Simek <monstr@monstr.eu>,
Vignesh Raghavendra <vigneshr@ti.com>,
Tudor Ambarus <Tudor.Ambarus@microchip.com>,
Richard Weinberger <richard@nod.at>,
linux-mtd@lists.infradead.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Naga Sureshkumar Relli <nagasure@xilinx.com>
Subject: Re: [PATCH v4 07/13] mtd: rawnand: Add a helper to check supported operations
Date: Mon, 4 May 2020 12:37:13 +0200 [thread overview]
Message-ID: <20200504123713.22c7f22f@collabora.com> (raw)
In-Reply-To: <20200504095237.1654-8-miquel.raynal@bootlin.com>
On Mon, 4 May 2020 11:52:31 +0200
Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> 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>
> ---
> drivers/mtd/nand/raw/internals.h | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/mtd/nand/raw/internals.h b/drivers/mtd/nand/raw/internals.h
> index 9d0caadf940e..b722af7a0b7e 100644
> --- a/drivers/mtd/nand/raw/internals.h
> +++ b/drivers/mtd/nand/raw/internals.h
> @@ -106,6 +106,15 @@ static inline bool nand_has_exec_op(struct nand_chip *chip)
> return true;
> }
>
> +static inline int nand_check_supported_op(struct nand_chip *chip,
> + const struct nand_operation *op)
I would just call that one nand_check_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)
> {
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-05-04 10:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 9:52 [PATCH v4 00/13] Supporting restricted NAND controllers Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 01/13] mtd: rawnand: Translate obscure bitfields into readable macros Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 02/13] mtd: rawnand: Reorder the nand_chip->options flags Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 03/13] mtd: rawnand: Rename a NAND chip option Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 04/13] mtd: rawnand: Fix comments about the use of bufpoi Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 05/13] mtd: rawnand: Rename the use_bufpoi variables Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 06/13] mtd: rawnand: Avoid indirect access to ->data_buf() Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 07/13] mtd: rawnand: Add a helper to check supported operations Miquel Raynal
2020-05-04 10:37 ` Boris Brezillon [this message]
2020-05-04 9:52 ` [PATCH v4 08/13] mtd: rawnand: Give the possibility to verify a read operation is supported Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 09/13] mtd: rawnand: onfi: Adapt the parameter page read to constraint controllers Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 10/13] mtd: rawnand: jedec: " Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 11/13] mtd: rawnand: Expose monolithic read/write_page_raw() helpers Miquel Raynal
2020-05-04 10:35 ` Boris Brezillon
2020-05-04 10:37 ` Miquel Raynal
2020-05-04 10:39 ` Boris Brezillon
2020-05-04 9:52 ` [PATCH v4 12/13] mtd: rawnand: Allow controllers to overload soft ECC hooks Miquel Raynal
2020-05-04 9:52 ` [PATCH v4 13/13] mtd: rawnand: micron: Allow controllers to overload raw accessors Miquel Raynal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200504123713.22c7f22f@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=Tudor.Ambarus@microchip.com \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=monstr@monstr.eu \
--cc=nagasure@xilinx.com \
--cc=richard@nod.at \
--cc=thomas.petazzoni@bootlin.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).