{
u32 i = 0;
+ /* register with global device tree */
+ strncpy(hwif->gendev.bus_id,hwif->name,BUS_ID_SIZE);
+ snprintf(hwif->gendev.name,DEVICE_NAME_SIZE,"IDE Controller");
+ device_register(&hwif->gendev);
+
if (hwif->mmio == 2)
return;
if (hwif->io_ports[IDE_CONTROL_OFFSET])
u16 unit = 0;
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
- if (drive->present)
+ if (drive->present) {
ata_attach(drive);
+ }
}
}
#endif
gd[unit].major_name = names + 4*unit;
gd[unit].minor_shift = PARTN_BITS;
gd[unit].fops = ide_fops;
+
+ snprintf(gd[unit].disk_dev.bus_id,BUS_ID_SIZE,"%u.%u",
+ hwif->index,unit);
+ snprintf(gd[unit].disk_dev.name,DEVICE_NAME_SIZE,
+ "%s","IDE Drive");
+ gd[unit].disk_dev.parent = &hwif->gendev;
+ gd[unit].disk_dev.bus = &ide_bus_type;
+ device_register(&gd[unit].disk_dev);
+
hwif->drives[unit].disk = gd + unit;
}
#include <linux/reboot.h>
#include <linux/cdrom.h>
#include <linux/seq_file.h>
+#include <linux/device.h>
#include <asm/byteorder.h>
#include <asm/irq.h>
5
};
+struct bus_type ide_bus_type = {
+ .name = "ide",
+};
+
/*
* This is gets invoked once during initialization, to set *everything* up
*/
banner_printed = 1;
}
+ bus_register(&ide_bus_type);
+
init_ide_data();
initializing = 1;
proc_ide_destroy();
#endif
devfs_unregister (ide_devfs_handle);
+
+ bus_unregister(&ide_bus_type);
}
#else /* !MODULE */
if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL)
continue;
+ /* setup proper ancestral information */
+ hwif->gendev.parent = &dev->dev;
+
if (hwif->channel) {
index.b.high = hwif->index;
} else {
unsigned highmem : 1; /* can do full 32-bit dma */
unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */
+ struct device gendev;
+
void *hwif_data; /* extra hwif data */
} ide_hwif_t;
#define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable(); } while (0)
+extern struct bus_type ide_bus_type;
+
#endif /* _IDE_H */