diff mbox series

[05/15] mtd: rawnand: Use nand_to_mtd() in nand_{set, get}_flash_node()

Message ID 20190221091527.20497-6-miquel.raynal@bootlin.com
State Changes Requested
Delegated to: Miquel Raynal
Headers show
Series mtd: rawnand: 5th batch of cleanups | expand

Commit Message

Miquel Raynal Feb. 21, 2019, 9:15 a.m. UTC
From: Boris Brezillon <bbrezillon@kernel.org>

Use the nand_to_mtd() helper to access chip->mtd as done everywhere
else.

Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 include/linux/mtd/rawnand.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Frieder Schrempf Feb. 23, 2019, 1:05 p.m. UTC | #1
On 21.02.19 10:15, Miquel Raynal wrote:
> From: Boris Brezillon <bbrezillon@kernel.org>
> 
> Use the nand_to_mtd() helper to access chip->mtd as done everywhere
> else.
> 
> Signed-off-by: Boris Brezillon <bbrezillon@kernel.org>
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>

Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>

> ---
>   include/linux/mtd/rawnand.h | 22 +++++++++++-----------
>   1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
> index 33e240acdc6d..c20ea012aab6 100644
> --- a/include/linux/mtd/rawnand.h
> +++ b/include/linux/mtd/rawnand.h
> @@ -1113,17 +1113,6 @@ struct nand_chip {
>   extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
>   extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops;
>   
> -static inline void nand_set_flash_node(struct nand_chip *chip,
> -				       struct device_node *np)
> -{
> -	mtd_set_of_node(&chip->mtd, np);
> -}
> -
> -static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
> -{
> -	return mtd_get_of_node(&chip->mtd);
> -}
> -
>   static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
>   {
>   	return container_of(mtd, struct nand_chip, mtd);
> @@ -1155,6 +1144,17 @@ static inline void *nand_get_manufacturer_data(struct nand_chip *chip)
>   	return chip->manufacturer.priv;
>   }
>   
> +static inline void nand_set_flash_node(struct nand_chip *chip,
> +				       struct device_node *np)
> +{
> +	mtd_set_of_node(nand_to_mtd(chip), np);
> +}
> +
> +static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
> +{
> +	return mtd_get_of_node(nand_to_mtd(chip));
> +}
> +
>   /*
>    * A helper for defining older NAND chips where the second ID byte fully
>    * defined the chip, including the geometry (chip size, eraseblock size, page
>
diff mbox series

Patch

diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
index 33e240acdc6d..c20ea012aab6 100644
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -1113,17 +1113,6 @@  struct nand_chip {
 extern const struct mtd_ooblayout_ops nand_ooblayout_sp_ops;
 extern const struct mtd_ooblayout_ops nand_ooblayout_lp_ops;
 
-static inline void nand_set_flash_node(struct nand_chip *chip,
-				       struct device_node *np)
-{
-	mtd_set_of_node(&chip->mtd, np);
-}
-
-static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
-{
-	return mtd_get_of_node(&chip->mtd);
-}
-
 static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
 {
 	return container_of(mtd, struct nand_chip, mtd);
@@ -1155,6 +1144,17 @@  static inline void *nand_get_manufacturer_data(struct nand_chip *chip)
 	return chip->manufacturer.priv;
 }
 
+static inline void nand_set_flash_node(struct nand_chip *chip,
+				       struct device_node *np)
+{
+	mtd_set_of_node(nand_to_mtd(chip), np);
+}
+
+static inline struct device_node *nand_get_flash_node(struct nand_chip *chip)
+{
+	return mtd_get_of_node(nand_to_mtd(chip));
+}
+
 /*
  * A helper for defining older NAND chips where the second ID byte fully
  * defined the chip, including the geometry (chip size, eraseblock size, page