summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:18 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-10 22:39:18 +0200
commitdf1f8378c2fd898fa08be5d72283d68c77f519e9 (patch)
tree986612db7f25f1d39ff8affdbaecc714674a090c /drivers/ide/ide-probe.c
parentf8881000d7cc6b8b520e8fcba95177d2cde1ae36 (diff)
ide: cleanup ide_disk_init_mult_count()
* Remove superfluous checks for drive->mult_req. * No need to zero drive's fields. * Move the common code out of #ifdef scope. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 70aa86c8807..a776a6d73c5 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -89,20 +89,19 @@ static void ide_disk_init_mult_count(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
- drive->mult_count = 0;
if (id->max_multsect) {
#ifdef CONFIG_IDEDISK_MULTI_MODE
- id->multsect = ((id->max_multsect/2) > 1) ? id->max_multsect : 0;
- id->multsect_valid = id->multsect ? 1 : 0;
- drive->mult_req = id->multsect_valid ? id->max_multsect : 0;
- drive->special.b.set_multmode = drive->mult_req ? 1 : 0;
-#else /* original, pre IDE-NFG, per request of AC */
- drive->mult_req = 0;
- if (drive->mult_req > id->max_multsect)
- drive->mult_req = id->max_multsect;
- if (drive->mult_req || ((id->multsect_valid & 1) && id->multsect))
- drive->special.b.set_multmode = 1;
+ if ((id->max_multsect / 2) > 1) {
+ id->multsect = id->max_multsect;
+ id->multsect_valid = 1;
+ } else {
+ id->multsect = 0;
+ id->multsect_valid = 0;
+ }
+ drive->mult_req = id->multsect;
#endif
+ if ((id->multsect_valid & 1) && id->multsect)
+ drive->special.b.set_multmode = 1;
}
}