Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 77251
b: refs/heads/master
c: 151575e
h: refs/heads/master
i:
  77249: 1243b95
  77247: 1908121
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 26, 2008
1 parent ac804a6 commit b30fa06
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 42 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71518342bfdfbe508ee325ab5e20984ba2da7de2
refs/heads/master: 151575e4644f917d3a9f83c777ac3543284954f8
8 changes: 7 additions & 1 deletion trunk/drivers/ide/ide-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@

static int __init ide_generic_init(void)
{
u8 idx[MAX_HWIFS];
int i;

if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
ide_get_lock(NULL, NULL); /* for atari only */

(void)ideprobe_init();
for (i = 0; i < MAX_HWIFS; i++)
idx[i] = ide_hwifs[i].present ? 0xff : i;

ide_device_add_all(idx);

if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
ide_release_lock(); /* for atari only */
Expand Down
54 changes: 16 additions & 38 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,52 +1340,19 @@ static void hwif_register_devices(ide_hwif_t *hwif)
}
}

int ideprobe_init (void)
{
unsigned int index;
int probe[MAX_HWIFS];

memset(probe, 0, MAX_HWIFS * sizeof(int));
for (index = 0; index < MAX_HWIFS; ++index)
probe[index] = !ide_hwifs[index].present;

for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
probe_hwif(&ide_hwifs[index]);
for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
hwif_init(&ide_hwifs[index]);
for (index = 0; index < MAX_HWIFS; ++index) {
if (probe[index]) {
ide_hwif_t *hwif = &ide_hwifs[index];
if (!hwif->present)
continue;
if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
hwif->chipset = ide_generic;
hwif_register_devices(hwif);
}
}
for (index = 0; index < MAX_HWIFS; ++index)
if (probe[index])
ide_proc_register_port(&ide_hwifs[index]);
return 0;
}

EXPORT_SYMBOL_GPL(ideprobe_init);

int ide_device_add(u8 idx[4])
int ide_device_add_all(u8 idx[MAX_HWIFS])
{
ide_hwif_t *hwif;
int i, rc = 0;

for (i = 0; i < 4; i++) {
for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;

probe_hwif(&ide_hwifs[idx[i]]);
}

for (i = 0; i < 4; i++) {
for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;

Expand All @@ -1399,7 +1366,7 @@ int ide_device_add(u8 idx[4])
}
}

for (i = 0; i < 4; i++) {
for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;

Expand All @@ -1413,12 +1380,23 @@ int ide_device_add(u8 idx[4])
}
}

for (i = 0; i < 4; i++) {
for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] != 0xff)
ide_proc_register_port(&ide_hwifs[idx[i]]);
}

return rc;
}
EXPORT_SYMBOL_GPL(ide_device_add_all);

int ide_device_add(u8 idx[4])
{
u8 idx_all[MAX_HWIFS];
int i;

for (i = 0; i < MAX_HWIFS; i++)
idx_all[i] = (i < 4) ? idx[i] : 0xff;

return ide_device_add_all(idx_all);
}
EXPORT_SYMBOL_GPL(ide_device_add);
3 changes: 1 addition & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,6 @@ extern void do_ide_request(struct request_queue *);

void ide_init_disk(struct gendisk *, ide_drive_t *);

extern int ideprobe_init(void);

#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
extern void ide_scan_pcibus(int scan_direction) __init;
extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
Expand Down Expand Up @@ -1203,6 +1201,7 @@ void ide_unregister_region(struct gendisk *);

void ide_undecoded_slave(ide_drive_t *);

int ide_device_add_all(u8 idx[MAX_HWIFS]);
int ide_device_add(u8 idx[4]);

static inline void *ide_get_hwifdata (ide_hwif_t * hwif)
Expand Down

0 comments on commit b30fa06

Please sign in to comment.