hd-geometry: Compute BIOS CHS translation in one place

Currently, it is split between hd_geometry_guess() and
pc_cmos_init_late().  Confusing.  info qtree shows the result of the
former.  Also confusing.

Fold the part done in pc_cmos_init_late() into hd_geometry_guess().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Markus Armbruster 2012-07-10 11:12:53 +02:00 committed by Kevin Wolf
parent 4e4e6e319b
commit 2adc99b277
5 changed files with 18 additions and 16 deletions

View file

@ -171,6 +171,9 @@ static int ide_dev_initfn(IDEDevice *dev, IDEDriveKind kind)
hd_geometry_guess(dev->conf.bs,
&dev->conf.cyls, &dev->conf.heads, &dev->conf.secs,
&dev->chs_trans);
} else if (dev->chs_trans == BIOS_ATA_TRANSLATION_AUTO) {
dev->chs_trans = hd_bios_chs_auto_trans(dev->conf.cyls,
dev->conf.heads, dev->conf.secs);
}
if (ide_init_drive(s, dev->conf.bs, kind,