aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-05-05 23:37:29 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-05-26 10:43:31 +0200
commit961965c45c706175b24227868b1c12d72775e446 (patch)
tree4c3515c277ff16d7976906b30a3ae045562af954 /include/linux/mtd
parentmtd: nand: bbt: Fix corner case in bad block table handling (diff)
downloadlinux-dev-961965c45c706175b24227868b1c12d72775e446.tar.xz
linux-dev-961965c45c706175b24227868b1c12d72775e446.zip
mtd: rawnand: Add a helper to clarify the interface configuration
Name it nand_interface_is_sdr() which will make even more sense when nand_interface_is_nvddr() will be introduced. Use it when relevant. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210505213750.257417-2-miquel.raynal@bootlin.com
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/rawnand.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 29df2f43dcb5..39b31f8e03b7 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -497,13 +497,22 @@ struct nand_interface_config {
};
/**
+ * nand_interface_is_sdr - get the interface type
+ * @conf: The data interface
+ */
+static bool nand_interface_is_sdr(const struct nand_interface_config *conf)
+{
+ return conf->type == NAND_SDR_IFACE;
+}
+
+/**
* nand_get_sdr_timings - get SDR timing from data interface
* @conf: The data interface
*/
static inline const struct nand_sdr_timings *
nand_get_sdr_timings(const struct nand_interface_config *conf)
{
- if (conf->type != NAND_SDR_IFACE)
+ if (!nand_interface_is_sdr(conf))
return ERR_PTR(-EINVAL);
return &conf->timings.sdr;