4,436
社区成员
发帖
与我相关
我的任务
分享
int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
probe_hwif(hwif);
if (fixup)
fixup(hwif);
if (!hwif_init(hwif)) {
printk(KERN_INFO "%s: failed to initialize IDE interface\n",
hwif->name);
return -1;
}
if (hwif->present) {
u16 unit = 0;
int ret;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
/* For now don't attach absent drives, we may
want them on default or a new "empty" class
for hotplug reprobing ? */
if (drive->present) {
ret = device_register(&drive->gendev);//这里进去就没出来
if (ret < 0)
printk(KERN_WARNING "IDE: %s: "
"device_register error: %d\n",
__FUNCTION__, ret);
}
}
}
return 0;
}
int device_register(struct device *dev)
{
device_initialize(dev);
return device_add(dev);//就是在这里面进入了死循环
}