Skip to contentSkip to conversation

nand: add containing structure for NAND platform data

patch/resend Vitaly Wool 1 participant 1 message Apr 30, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

In order to make it more convenient to pass platform-specific NAND stuff to a generic driver which is hopefully to come out next, I've introduced a container structure for chip-specific and controller-specific data. I'd expect that use cases in platform code will be like

struct platform_nand_data nand_data = {
	...
};
struct platform_device nand_device = {
	...
	.dev = {
		.platform_data = &nand_data,
		...
	},
};

So, please find the patch below.

include/linux/mtd/nand.h | 10 ++++++++++

1 files changed, 10 insertions(+)
include/linux/mtd/nand.h +0 -0
Index: linux-2.6/include/linux/mtd/nand.h
===================================================================
@@ -592,6 +592,16 @@ struct platform_nand_ctrl {
	void		*priv;
};

+/**
+ * struct platform_nand_data - container structure for platform-specific data
+ * @chip: chip level chip structure
+ * @ctrl: controller level device structure
+ */
+struct platform_nand_data {
+ struct platform_nand_chip chip;
+ struct platform_nand_ctrl ctrl;
+};
+
/* Some helpers to access the data structures */
static inline
struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)