Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 71743
b: refs/heads/master
c: 9601a60
h: refs/heads/master
i:
  71741: 9895b98
  71739: 1e49328
  71735: f52fecf
  71727: f953a03
  71711: b2d47d3
  71679: f5fb021
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 19, 2007
1 parent 5aeeaea commit a984f06
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 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: b515da89c6f4d3c3c2a19358ce0304046c043ea1
refs/heads/master: 9601a607cceb3632cde6c66fe28a3673dcd20be5
49 changes: 22 additions & 27 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
}

static int hwif_init(ide_hwif_t *hwif);
static void hwif_register_devices(ide_hwif_t *hwif);

int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
{
Expand All @@ -870,24 +871,9 @@ int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif)
return -1;
}

if (hwif->present) {
u16 unit = 0;
int ret;
if (hwif->present)
hwif_register_devices(hwif);

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;
}

Expand Down Expand Up @@ -1379,6 +1365,24 @@ static int hwif_init(ide_hwif_t *hwif)
return 0;
}

static void hwif_register_devices(ide_hwif_t *hwif)
{
unsigned int i;

for (i = 0; i < MAX_DRIVES; i++) {
ide_drive_t *drive = &hwif->drives[i];

if (drive->present) {
int ret = device_register(&drive->gendev);

if (ret < 0)
printk(KERN_WARNING "IDE: %s: "
"device_register error: %d\n",
__FUNCTION__, ret);
}
}
}

int ideprobe_init (void)
{
unsigned int index;
Expand All @@ -1397,20 +1401,11 @@ int ideprobe_init (void)
for (index = 0; index < MAX_HWIFS; ++index) {
if (probe[index]) {
ide_hwif_t *hwif = &ide_hwifs[index];
int unit;
if (!hwif->present)
continue;
if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
hwif->chipset = ide_generic;
for (unit = 0; unit < MAX_DRIVES; ++unit)
if (hwif->drives[unit].present) {
int ret = device_register(
&hwif->drives[unit].gendev);
if (ret < 0)
printk(KERN_WARNING "IDE: %s: "
"device_register error: %d\n",
__FUNCTION__, ret);
}
hwif_register_devices(hwif);
}
}
for (index = 0; index < MAX_HWIFS; ++index)
Expand Down

0 comments on commit a984f06

Please sign in to comment.