mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
mtd: nand: Add+use mtd_to/from_nand and nand_get/set_controller_data
These functions are part of the Linux 4.6 sync. They are being added before the main sync patch in order to make it easier to address the issue across all NAND drivers (many/most of which do not closely track their Linux counterparts) separately from other merge issues. Signed-off-by: Scott Wood <oss@buserror.net>
This commit is contained in:
parent
b616d9b0a7
commit
17cb4b8f32
38 changed files with 328 additions and 317 deletions
|
@ -740,6 +740,26 @@ struct nand_chip {
|
|||
void *priv;
|
||||
};
|
||||
|
||||
static inline struct nand_chip *mtd_to_nand(struct mtd_info *mtd)
|
||||
{
|
||||
return container_of(mtd, struct nand_chip, mtd);
|
||||
}
|
||||
|
||||
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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue