aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index aeb1ad782f5..1f07f381893 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -342,38 +342,38 @@ static ide_startstop_t ide_floppy_do_request(ide_drive_t *drive,
342 * Look at the flexible disk page parameters. We ignore the CHS capacity 342 * Look at the flexible disk page parameters. We ignore the CHS capacity
343 * parameters and use the LBA parameters instead. 343 * parameters and use the LBA parameters instead.
344 */ 344 */
345static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive) 345static int ide_floppy_get_flexible_disk_page(ide_drive_t *drive,
346 struct ide_atapi_pc *pc)
346{ 347{
347 struct ide_disk_obj *floppy = drive->driver_data; 348 struct ide_disk_obj *floppy = drive->driver_data;
348 struct gendisk *disk = floppy->disk; 349 struct gendisk *disk = floppy->disk;
349 struct ide_atapi_pc pc;
350 u8 *page; 350 u8 *page;
351 int capacity, lba_capacity; 351 int capacity, lba_capacity;
352 u16 transfer_rate, sector_size, cyls, rpm; 352 u16 transfer_rate, sector_size, cyls, rpm;
353 u8 heads, sectors; 353 u8 heads, sectors;
354 354
355 ide_floppy_create_mode_sense_cmd(&pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE); 355 ide_floppy_create_mode_sense_cmd(pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE);
356 356
357 if (ide_queue_pc_tail(drive, disk, &pc)) { 357 if (ide_queue_pc_tail(drive, disk, pc)) {
358 printk(KERN_ERR PFX "Can't get flexible disk page params\n"); 358 printk(KERN_ERR PFX "Can't get flexible disk page params\n");
359 return 1; 359 return 1;
360 } 360 }
361 361
362 if (pc.buf[3] & 0x80) 362 if (pc->buf[3] & 0x80)
363 drive->dev_flags |= IDE_DFLAG_WP; 363 drive->dev_flags |= IDE_DFLAG_WP;
364 else 364 else
365 drive->dev_flags &= ~IDE_DFLAG_WP; 365 drive->dev_flags &= ~IDE_DFLAG_WP;
366 366
367 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP)); 367 set_disk_ro(disk, !!(drive->dev_flags & IDE_DFLAG_WP));
368 368
369 page = &pc.buf[8]; 369 page = &pc->buf[8];
370 370
371 transfer_rate = be16_to_cpup((__be16 *)&pc.buf[8 + 2]); 371 transfer_rate = be16_to_cpup((__be16 *)&pc->buf[8 + 2]);
372 sector_size = be16_to_cpup((__be16 *)&pc.buf[8 + 6]); 372 sector_size = be16_to_cpup((__be16 *)&pc->buf[8 + 6]);
373 cyls = be16_to_cpup((__be16 *)&pc.buf[8 + 8]); 373 cyls = be16_to_cpup((__be16 *)&pc->buf[8 + 8]);
374 rpm = be16_to_cpup((__be16 *)&pc.buf[8 + 28]); 374 rpm = be16_to_cpup((__be16 *)&pc->buf[8 + 28]);
375 heads = pc.buf[8 + 4]; 375 heads = pc->buf[8 + 4];
376 sectors = pc.buf[8 + 5]; 376 sectors = pc->buf[8 + 5];
377 377
378 capacity = cyls * heads * sectors * sector_size; 378 capacity = cyls * heads * sectors * sector_size;
379 379
@@ -499,7 +499,7 @@ static int ide_floppy_get_capacity(ide_drive_t *drive)
499 499
500 /* Clik! disk does not support get_flexible_disk_page */ 500 /* Clik! disk does not support get_flexible_disk_page */
501 if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE)) 501 if (!(drive->atapi_flags & IDE_AFLAG_CLIK_DRIVE))
502 (void) ide_floppy_get_flexible_disk_page(drive); 502 (void) ide_floppy_get_flexible_disk_page(drive, &pc);
503 503
504 return rc; 504 return rc;
505} 505}