Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105006
b: refs/heads/master
c: 1f2efb8
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent a595d64 commit 83e660e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 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: 92eb43800a3c1300bd5cb8a2a27e6f2a84f7042e
refs/heads/master: 1f2efb82af3cfbac995f590a8f8d3beb6fa5678b
17 changes: 14 additions & 3 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,18 @@ static int ide_busy_sleep(ide_hwif_t *hwif)
return 1;
}

static u8 ide_read_device(ide_drive_t *drive)
{
ide_task_t task;

memset(&task, 0, sizeof(task));
task.tf_flags = IDE_TFLAG_IN_DEVICE;

drive->hwif->tf_read(drive, &task);

return task.tf.device;
}

/**
* do_probe - probe an IDE device
* @drive: drive to probe
Expand All @@ -434,7 +446,6 @@ static int ide_busy_sleep(ide_hwif_t *hwif)
static int do_probe (ide_drive_t *drive, u8 cmd)
{
ide_hwif_t *hwif = HWIF(drive);
struct ide_io_ports *io_ports = &hwif->io_ports;
int rc;
u8 stat;

Expand All @@ -455,8 +466,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
msleep(50);
SELECT_DRIVE(drive);
msleep(50);
if (hwif->INB(io_ports->device_addr) != drive->select.all &&
!drive->present) {

if (ide_read_device(drive) != drive->select.all && !drive->present) {
if (drive->select.b.unit != 0) {
/* exit with drive0 selected */
SELECT_DRIVE(&hwif->drives[0]);
Expand Down

0 comments on commit 83e660e

Please sign in to comment.