日期:2014-05-16 浏览次数:20720 次
/* DM9000AEP 10/100 ethernet controller */ static struct resource mini2440_dm9k_resource[] = { [0] = { .start = MACH_MINI2440_DM9K_BASE, .end = MACH_MINI2440_DM9K_BASE + 3, .flags = IORESOURCE_MEM }, [1] = { .start = MACH_MINI2440_DM9K_BASE + 4, .end = MACH_MINI2440_DM9K_BASE + 7, .flags = IORESOURCE_MEM }, [2] = { .start = IRQ_EINT7, .end = IRQ_EINT7, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, } }; static struct dm9000_plat_data mini2440_dm9k_pdata = { .flags = (DM9000_PLATF_16BITONLY | DM9000_PLATF_NO_EEPROM), }; static struct platform_device mini2440_device_eth = { .name = "dm9000", .id = -1, .num_resources = ARRAY_SIZE(mini2440_dm9k_resource), .resource = mini2440_dm9k_resource, .dev = { .platform_data = &mini2440_dm9k_pdata, }, };
------解决方案--------------------
抱歉 一时激动说错了,
变化的东西申请一个platform_device结构来描述,最终要把这个platform_devi的ce结构加入那个
static struct platform_device *mini2440_devices[] __initdata =
这个是没办法省的,platform驱动就是这么用的
除非是pci、usb总线,总线控制器能自动检测设备。这个dm9000一般挂在soc的local bus上,物理总线无法提供探测设备的功能,只好虚拟一条platform总线,程序员自己告诉驱动关于设备的信息