@@ -575,11 +575,8 @@ static int set_nowerr(ide_drive_t *drive, int arg)
575575 if (arg < 0 || arg > 1 )
576576 return - EINVAL ;
577577
578- if (ide_spin_wait_hwgroup (drive ))
579- return - EBUSY ;
580578 drive -> nowerr = arg ;
581579 drive -> bad_wstat = arg ? BAD_R_STAT : BAD_W_STAT ;
582- spin_unlock_irq (& ide_lock );
583580 return 0 ;
584581}
585582
@@ -702,33 +699,34 @@ static int set_addressing(ide_drive_t *drive, int arg)
702699 return 0 ;
703700}
704701
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+
705709#ifdef CONFIG_IDE_PROC_FS
706- ide_devset_rw_nolock (acoustic , 0 , 254 , acoustic );
707- ide_devset_rw_nolock (address , 0 , 2 , addressing );
708- ide_devset_rw_nolock (multcount , 0 , 16 , multcount );
709- ide_devset_rw_nolock (nowerr , 0 , 1 , nowerr );
710- ide_devset_rw_nolock (wcache , 0 , 1 , wcache );
711-
712- ide_devset_rw (bios_cyl , 0 , 65535 , bios_cyl );
713- ide_devset_rw (bios_head , 0 , 255 , bios_head );
714- ide_devset_rw (bios_sect , 0 , 63 , bios_sect );
715- ide_devset_rw (failures , 0 , 65535 , failures );
716- ide_devset_rw (lun , 0 , 7 , lun );
717- ide_devset_rw (max_failures , 0 , 65535 , max_failures );
718-
719- static const struct ide_devset * idedisk_settings [] = {
720- & ide_devset_acoustic ,
721- & ide_devset_address ,
722- & ide_devset_bios_cyl ,
723- & ide_devset_bios_head ,
724- & ide_devset_bios_sect ,
725- & ide_devset_failures ,
726- & ide_devset_lun ,
727- & ide_devset_max_failures ,
728- & ide_devset_multcount ,
729- & ide_devset_nowerr ,
730- & ide_devset_wcache ,
731- NULL
710+ ide_devset_rw_field (bios_cyl , bios_cyl );
711+ ide_devset_rw_field (bios_head , bios_head );
712+ ide_devset_rw_field (bios_sect , bios_sect );
713+ ide_devset_rw_field (failures , failures );
714+ ide_devset_rw_field (lun , lun );
715+ ide_devset_rw_field (max_failures , max_failures );
716+
717+ static const struct ide_proc_devset idedisk_settings [] = {
718+ IDE_PROC_DEVSET (acoustic , 0 , 254 ),
719+ IDE_PROC_DEVSET (address , 0 , 2 ),
720+ IDE_PROC_DEVSET (bios_cyl , 0 , 65535 ),
721+ IDE_PROC_DEVSET (bios_head , 0 , 255 ),
722+ IDE_PROC_DEVSET (bios_sect , 0 , 63 ),
723+ IDE_PROC_DEVSET (failures , 0 , 65535 ),
724+ IDE_PROC_DEVSET (lun , 0 , 7 ),
725+ IDE_PROC_DEVSET (max_failures , 0 , 65535 ),
726+ IDE_PROC_DEVSET (multcount , 0 , 16 ),
727+ IDE_PROC_DEVSET (nowerr , 0 , 1 ),
728+ IDE_PROC_DEVSET (wcache , 0 , 1 ),
729+ { 0 },
732730};
733731#endif
734732
@@ -1001,11 +999,11 @@ static int idedisk_getgeo(struct block_device *bdev, struct hd_geometry *geo)
1001999}
10021000
10031001static const struct ide_ioctl_devset ide_disk_ioctl_settings [] = {
1004- { HDIO_GET_ADDRESS , HDIO_SET_ADDRESS , get_addressing , set_addressing },
1005- { HDIO_GET_MULTCOUNT , HDIO_SET_MULTCOUNT , get_multcount , set_multcount },
1006- { HDIO_GET_NOWERR , HDIO_SET_NOWERR , get_nowerr , set_nowerr },
1007- { HDIO_GET_WCACHE , HDIO_SET_WCACHE , get_wcache , set_wcache },
1008- { HDIO_GET_ACOUSTIC , HDIO_SET_ACOUSTIC , get_acoustic , set_acoustic },
1002+ { HDIO_GET_ADDRESS , HDIO_SET_ADDRESS , & ide_devset_address },
1003+ { HDIO_GET_MULTCOUNT , HDIO_SET_MULTCOUNT , & ide_devset_multcount },
1004+ { HDIO_GET_NOWERR , HDIO_SET_NOWERR , & ide_devset_nowerr },
1005+ { HDIO_GET_WCACHE , HDIO_SET_WCACHE , & ide_devset_wcache },
1006+ { HDIO_GET_ACOUSTIC , HDIO_SET_ACOUSTIC , & ide_devset_acoustic },
10091007{ 0 }
10101008};
10111009
0 commit comments