uClinux2.6(bf561)的NorFlash驱动实现分析(8): check_cmd_set
2008-02-21 18:43
375 查看
这个函数位于driver/mtd/chips/gen_probe.c,它直接转向cfi_cmdset_0002(此函数位于driver/mtd/chips/cfi_cmdset_0002.c)继续运行,正是在这个函数中,分配了一个mtd struct并在其中填上相应的值或者回调函数。
struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary)
{
struct cfi_private *cfi = map->fldrv_priv;
struct mtd_info *mtd;
int i;
mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
if (!mtd) {
printk(KERN_WARNING "Failed to allocate memory for MTD device/n");
return NULL;
}
memset(mtd, 0, sizeof(*mtd));
mtd->priv = map;
mtd->type = MTD_NORFLASH;
/* Fill in the default mtd operations */
…
return cfi_amdstd_setup(mtd);
}
相关文章推荐
- uClinux2.6(bf561)的NorFlash驱动实现分析(5) : 驱动加载
- uClinux2.6(bf561)的NorFlash驱动实现分析(6): do_map_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(7): cfi_probe
- uClinux2.6(bf561)的NorFlash驱动实现分析(9): 驱动的使用
- uClinux 2.6(bf561)中的NorFlash驱动实现分析:全文
- uClinux2.6(bf561)的NorFlash驱动实现分析(1): 基本参数
- uClinux2.6(bf561)的NorFlash驱动实现分析(2): chips和maps
- uClinux2.6(bf561)的NorFlash驱动实现分析(3) : chip_driver注册
- uClinux2.6(bf561)的NorFlash驱动实现分析(4) : maps定义
- uclinux2.6(bf561)中的bootmem分析(4):alloc_bootmem_pages
- uclinux2.6(bf561)中的bootmem分析(1):猜测
- uclinux2.6(bf561)中的bootmem分析(3):init_bootmem_node
- uclinux2.6(bf561)中的bootmem分析(2):调用前的参数分析
- 基于MTD的NANDFLASH设备驱动底层实现原理分析(二)
- 摄像头驱动实现源码分析
- 采用双内核机制基于uClinux的实时操作系统分析与实现 form:http://www.eetchina.com
- s3c2410触摸屏驱动(2.6内核)分析
- Linux 2.6内核ACL机制数据结构和实现分析
- linux2.6驱动编程第一例:hello,world的实现步骤
- 基于MTD的NANDFLASH设备驱动底层实现原理分析(一)