mtd: nand: add helpers to access ->priv

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 12 15:59:31 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d39ddbd9ef70949bb78283a067e1b3366111dd90
Commit:     d39ddbd9ef70949bb78283a067e1b3366111dd90
Parent:     ae02ab00aa3c282a362af8c4496496970747ddf4
Author:     Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Thu Dec 10 09:00:39 2015 +0100
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Thu Jan 7 09:55:39 2016 -0800

    mtd: nand: add helpers to access ->priv
    
    Add two helpers to access the field reserved for private controller data.
    This makes it clearer what this field is reserved for and ease future
    refactoring.
    
    Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 include/linux/mtd/nand.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 86487db..bdd68e2 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -755,6 +755,16 @@ static inline struct mtd_info *nand_to_mtd(struct nand_chip *chip)
 	return &chip->mtd;
 }
 
+static inline void *nand_get_controller_data(struct nand_chip *chip)
+{
+	return chip->priv;
+}
+
+static inline void nand_set_controller_data(struct nand_chip *chip, void *priv)
+{
+	chip->priv = priv;
+}
+
 /*
  * NAND Flash Manufacturer ID Codes
  */



More information about the linux-mtd-cvs mailing list