diff options
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 5df00d4ab8da..be21cf23f8cb 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -318,7 +318,7 @@ static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive, | |||
318 | 318 | ||
319 | ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE); | 319 | ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE); |
320 | 320 | ||
321 | if (ide_queue_pc_tail(drive, disk, pc, pc->req_xfer)) { | 321 | if (ide_queue_pc_tail(drive, disk, pc, pc->buf, pc->req_xfer)) { |
322 | printk(KERN_ERR PFX "Can't get flexible disk page params\n"); | 322 | printk(KERN_ERR PFX "Can't get flexible disk page params\n"); |
323 | return 1; | 323 | return 1; |
324 | } | 324 | } |
@@ -387,22 +387,21 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
387 | drive->capacity64 = 0; | 387 | drive->capacity64 = 0; |
388 | 388 | ||
389 | ide_floppy_create_read_capacity_cmd(&pc); | 389 | ide_floppy_create_read_capacity_cmd(&pc); |
390 | pc.buf = &pc_buf[0]; | ||
391 | pc.buf_size = sizeof(pc_buf); | 390 | pc.buf_size = sizeof(pc_buf); |
392 | 391 | ||
393 | if (ide_queue_pc_tail(drive, disk, &pc, pc.req_xfer)) { | 392 | if (ide_queue_pc_tail(drive, disk, &pc, pc_buf, pc.req_xfer)) { |
394 | printk(KERN_ERR PFX "Can't get floppy parameters\n"); | 393 | printk(KERN_ERR PFX "Can't get floppy parameters\n"); |
395 | return 1; | 394 | return 1; |
396 | } | 395 | } |
397 | header_len = pc.buf[3]; | 396 | header_len = pc_buf[3]; |
398 | cap_desc = &pc.buf[4]; | 397 | cap_desc = &pc_buf[4]; |
399 | desc_cnt = header_len / 8; /* capacity descriptor of 8 bytes */ | 398 | desc_cnt = header_len / 8; /* capacity descriptor of 8 bytes */ |
400 | 399 | ||
401 | for (i = 0; i < desc_cnt; i++) { | 400 | for (i = 0; i < desc_cnt; i++) { |
402 | unsigned int desc_start = 4 + i*8; | 401 | unsigned int desc_start = 4 + i*8; |
403 | 402 | ||
404 | blocks = be32_to_cpup((__be32 *)&pc.buf[desc_start]); | 403 | blocks = be32_to_cpup((__be32 *)&pc_buf[desc_start]); |
405 | length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); | 404 | length = be16_to_cpup((__be16 *)&pc_buf[desc_start + 6]); |
406 | 405 | ||
407 | ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, " | 406 | ide_debug_log(IDE_DBG_PROBE, "Descriptor %d: %dkB, %d blocks, " |
408 | "%d sector size", | 407 | "%d sector size", |
@@ -415,7 +414,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
415 | * the code below is valid only for the 1st descriptor, ie i=0 | 414 | * the code below is valid only for the 1st descriptor, ie i=0 |
416 | */ | 415 | */ |
417 | 416 | ||
418 | switch (pc.buf[desc_start + 4] & 0x03) { | 417 | switch (pc_buf[desc_start + 4] & 0x03) { |
419 | /* Clik! drive returns this instead of CAPACITY_CURRENT */ | 418 | /* Clik! drive returns this instead of CAPACITY_CURRENT */ |
420 | case CAPACITY_UNFORMATTED: | 419 | case CAPACITY_UNFORMATTED: |
421 | if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) | 420 | if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) |
@@ -464,7 +463,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive) | |||
464 | break; | 463 | break; |
465 | } | 464 | } |
466 | ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d", | 465 | ide_debug_log(IDE_DBG_PROBE, "Descriptor 0 Code: %d", |
467 | pc.buf[desc_start + 4] & 0x03); | 466 | pc_buf[desc_start + 4] & 0x03); |
468 | } | 467 | } |
469 | 468 | ||
470 | /* Clik! disk does not support get_flexible_disk_page */ | 469 | /* Clik! disk does not support get_flexible_disk_page */ |