diff options
author | Elias Oltmanns <eo@nebensachen.de> | 2008-10-10 16:39:40 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-10 16:39:40 -0400 |
commit | 92f1f8fd8040e7b50a67a850a935509bb01201bb (patch) | |
tree | df27468982bc64f0a6fdc54f05153e382ca63a1b /drivers/ide/ide-disk.c | |
parent | d6e2955a6b82d2312b5ff885ce13c8ab54d59d96 (diff) |
ide: Remove ide_spin_wait_hwgroup() and use special requests instead
Use a special request for serialisation purposes and get rid of the
awkward ide_spin_wait_hwgroup(). This also involves converting the
ide_devset structure so it can be shared by the /proc and the ioctl code.
Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
[bart: use rq->cmd[] directly]
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 119063470820..01846f244b40 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -575,11 +575,8 @@ static int set_nowerr(ide_drive_t *drive, int arg) | |||
575 | if (arg < 0 || arg > 1) | 575 | if (arg < 0 || arg > 1) |
576 | return -EINVAL; | 576 | return -EINVAL; |
577 | 577 | ||
578 | if (ide_spin_wait_hwgroup(drive)) | ||
579 | return -EBUSY; | ||
580 | drive->nowerr = arg; | 578 | drive->nowerr = arg; |
581 | drive->bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT; | 579 | drive->bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT; |
582 | spin_unlock_irq(&ide_lock); | ||
583 | return 0; | 580 | return 0; |
584 | } | 581 | } |
585 | 582 | ||
@@ -702,33 +699,34 @@ static int set_addressing(ide_drive_t *drive, int arg) | |||
702 | return 0; | 699 | return 0; |
703 | } | 700 | } |
704 | 701 | ||
702 | ide_devset_rw(acoustic, acoustic); | ||
703 | ide_devset_rw(address, addressing); | ||
704 | ide_devset_rw(multcount, multcount); | ||
705 | ide_devset_rw(wcache, wcache); | ||
706 | |||
707 | ide_devset_rw_sync(nowerr, nowerr); | ||
708 | |||
705 | #ifdef CONFIG_IDE_PROC_FS | 709 | #ifdef CONFIG_IDE_PROC_FS |
706 | ide_devset_rw_nolock(acoustic, 0, 254, acoustic); | 710 | ide_devset_rw_field(bios_cyl, bios_cyl); |
707 | ide_devset_rw_nolock(address, 0, 2, addressing); | 711 | ide_devset_rw_field(bios_head, bios_head); |
708 | ide_devset_rw_nolock(multcount, 0, 16, multcount); | 712 | ide_devset_rw_field(bios_sect, bios_sect); |
709 | ide_devset_rw_nolock(nowerr, 0, 1, nowerr); | 713 | ide_devset_rw_field(failures, failures); |
710 | ide_devset_rw_nolock(wcache, 0, 1, wcache); | 714 | ide_devset_rw_field(lun, lun); |
711 | 715 | ide_devset_rw_field(max_failures, max_failures); | |
712 | ide_devset_rw(bios_cyl, 0, 65535, bios_cyl); | 716 | |
713 | ide_devset_rw(bios_head, 0, 255, bios_head); | 717 | static const struct ide_proc_devset idedisk_settings[] = { |
714 | ide_devset_rw(bios_sect, 0, 63, bios_sect); | 718 | IDE_PROC_DEVSET(acoustic, 0, 254), |
715 | ide_devset_rw(failures, 0, 65535, failures); | 719 | IDE_PROC_DEVSET(address, 0, 2), |
716 | ide_devset_rw(lun, 0, 7, lun); | 720 | IDE_PROC_DEVSET(bios_cyl, 0, 65535), |
717 | ide_devset_rw(max_failures, 0, 65535, max_failures); | 721 | IDE_PROC_DEVSET(bios_head, 0, 255), |
718 | 722 | IDE_PROC_DEVSET(bios_sect, 0, 63), | |
719 | static const struct ide_devset *idedisk_settings[] = { | 723 | IDE_PROC_DEVSET(failures, 0, 65535), |
720 | &ide_devset_acoustic, | 724 | IDE_PROC_DEVSET(lun, 0, 7), |
721 | &ide_devset_address, | 725 | IDE_PROC_DEVSET(max_failures, 0, 65535), |
722 | &ide_devset_bios_cyl, | 726 | IDE_PROC_DEVSET(multcount, 0, 16), |
723 | &ide_devset_bios_head, | 727 | IDE_PROC_DEVSET(nowerr, 0, 1), |
724 | &ide_devset_bios_sect, | 728 | IDE_PROC_DEVSET(wcache, 0, 1), |
725 | &ide_devset_failures, | 729 | { 0 }, |
726 | &ide_devset_lun, | ||
727 | &ide_devset_max_failures, | ||
728 | &ide_devset_multcount, | ||
729 | &ide_devset_nowerr, | ||
730 | &ide_devset_wcache, | ||
731 | NULL | ||
732 | }; | 730 | }; |
733 | #endif | 731 | #endif |
734 | 732 | ||
@@ -1001,11 +999,11 @@ static int idedisk_getgeo(struct block_device *bdev, struct hd_geometry *geo) | |||
1001 | } | 999 | } |
1002 | 1000 | ||
1003 | static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { | 1001 | static const struct ide_ioctl_devset ide_disk_ioctl_settings[] = { |
1004 | { HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, get_addressing, set_addressing }, | 1002 | { HDIO_GET_ADDRESS, HDIO_SET_ADDRESS, &ide_devset_address }, |
1005 | { HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, get_multcount, set_multcount }, | 1003 | { HDIO_GET_MULTCOUNT, HDIO_SET_MULTCOUNT, &ide_devset_multcount }, |
1006 | { HDIO_GET_NOWERR, HDIO_SET_NOWERR, get_nowerr, set_nowerr }, | 1004 | { HDIO_GET_NOWERR, HDIO_SET_NOWERR, &ide_devset_nowerr }, |
1007 | { HDIO_GET_WCACHE, HDIO_SET_WCACHE, get_wcache, set_wcache }, | 1005 | { HDIO_GET_WCACHE, HDIO_SET_WCACHE, &ide_devset_wcache }, |
1008 | { HDIO_GET_ACOUSTIC, HDIO_SET_ACOUSTIC, get_acoustic, set_acoustic }, | 1006 | { HDIO_GET_ACOUSTIC, HDIO_SET_ACOUSTIC, &ide_devset_acoustic }, |
1009 | { 0 } | 1007 | { 0 } |
1010 | }; | 1008 | }; |
1011 | 1009 | ||