1
0
Fork 0

[POWERPC] Fix viodasd geometry calculations

Commit a885c8c431 that introduced the
getgeo block device method changed the fallback number of sectors and
introduced a bug into the fallback cylinder number calculation.

Thanks to Rusty Russell for noticing this.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
hifive-unleashed-5.1
Stephen Rothwell 2007-05-29 16:06:54 +10:00 committed by Paul Mackerras
parent b8ce2272be
commit 36a700307e
1 changed files with 2 additions and 2 deletions

View File

@ -252,10 +252,10 @@ static int viodasd_getgeo(struct block_device *bdev, struct hd_geometry *geo)
struct gendisk *disk = bdev->bd_disk;
struct viodasd_device *d = disk->private_data;
geo->sectors = d->sectors ? d->sectors : 0;
geo->sectors = d->sectors ? d->sectors : 32;
geo->heads = d->tracks ? d->tracks : 64;
geo->cylinders = d->cylinders ? d->cylinders :
get_capacity(disk) / (geo->cylinders * geo->heads);
get_capacity(disk) / (geo->sectors * geo->heads);
return 0;
}