As a preparation for allocating the data interface structure dynamically (and rename it), let's avoid accessing chip->data_interface directly. Instead, we introduce a helper, nand_get_interface_config(), and use it to retrieve the current data interface configuration out of a nand_chip object.
Showing the changes to include/linux (1 of 8 files). Show all
Unified · Split
| @@ -1203,6 +1203,17 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip) · 1202 unmodified lines | |||
| 1203 | return mtd_get_of_node(nand_to_mtd(chip)); | 1203 | return mtd_get_of_node(nand_to_mtd(chip)); |
| 1204 | } | 1204 | } |
| 1205 | 1205 | ||
| 1206 | /** | ||
| 1207 | * nand_get_interface_config - Retrieve the current interface configuration | ||
| 1208 | * of a NAND chip | ||
| 1209 | * @chip: The NAND chip | ||
| 1210 | */ | ||
| 1211 | static inline const struct nand_data_interface * | ||
| 1212 | nand_get_interface_config(struct nand_chip *chip) | ||
| 1213 | { | ||
| 1214 | return &chip->data_interface; | ||
| 1215 | } | ||
| 1216 | |||
| 1206 | /* | 1217 | /* |
| 1207 | * A helper for defining older NAND chips where the second ID byte fully | 1218 | * A helper for defining older NAND chips where the second ID byte fully |
| 1208 | * defined the chip, including the geometry (chip size, eraseblock size, page | 1219 | * defined the chip, including the geometry (chip size, eraseblock size, page |