Linux 下 Nand Flash 调用关系

Nand Flash 设备添加时数据结构包含关系

struct mtd_partition        partition_info[]

--> struct s3c2410_nand_set     nandset

--> struct s3c2410_platform_nand superlpplatfrom

--> struct platform_device      s3c_device_nand

在该数据结构的 name 字段的初始化值"s3c2410-nand",必须与 Nand Flash 设备驱动注册时 struct device_driver结构中的 name 字段相同,因为 platfrom bus 是依靠名字来匹配的.

--> struct platform_device      *smdk2410_devices[]

 Nand Flash 设备注册时数据结构包含关系

struct device_driver s3c2410_nand_driver

-->struct device *dev 该数据构由系统分配.

-->struct platform_device *pdev

-->struct s3c2410_platform_nand *plat

-->struct s3c2410_nand_set nset

-->struct mtd_partition

当发生系统调用时数据结构调用关系

struct mtd_info

它的*priv 指向 chip

-->struct nand_chip 它的*priv 指向 nmtd

-->struct s3c2410_nand_mtd

它是 s3c2410_nand_info 的一个字段

-->s3c2410_nand_info

它被设为 Nand Flash 设备驱动的私有数据结构,在 Nand Flash 设备驱动注册时分配空间.

-->struct device

猜你喜欢

转载自www.cnblogs.com/fanweisheng/p/11106193.html