History

mtd: rawnand: Hide the chip->data_interface indirection

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.

Miquel Raynal committed 6 years ago

Commit e0160cd1 parent d1bfe1e8 files · +45 −28Browse files

Showing the changes to include/linux (1 of 8 files). Show all

Unified · Split

include/linux/mtd/rawnand.h+11−0
@@ -1203,6 +1203,17 @@ static inline struct device_node *nand_get_flash_node(struct nand_chip *chip) · 1202 unmodified lines
12031203 return mtd_get_of_node(nand_to_mtd(chip));
12041204 }
12051205
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+
12061217 /*
12071218 * A helper for defining older NAND chips where the second ID byte fully
12081219 * defined the chip, including the geometry (chip size, eraseblock size, page