X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fide%2Fide-floppy.c;h=1f8db9ac05d12def5a5fe8f49a7492e628e4a0bb;hb=ca94f26d2b2ee8ad76be617b35f846444fedc07b;hp=f615ab759962d3ef50b454e6f178dc81faaa3908;hpb=7669a22592fc6cc7ac03f55a7db8d23ce938f1dc;p=powerpc.git diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index f615ab7599..1f8db9ac05 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c @@ -1871,9 +1871,8 @@ static void idefloppy_setup (ide_drive_t *drive, idefloppy_floppy_t *floppy) idefloppy_add_settings(drive); } -static int ide_floppy_remove(struct device *dev) +static void ide_floppy_remove(ide_drive_t *drive) { - ide_drive_t *drive = to_ide_device(dev); idefloppy_floppy_t *floppy = drive->driver_data; struct gendisk *g = floppy->disk; @@ -1882,8 +1881,6 @@ static int ide_floppy_remove(struct device *dev) del_gendisk(g); ide_floppy_put(floppy); - - return 0; } static void ide_floppy_release(struct kref *kref) @@ -1922,16 +1919,16 @@ static ide_proc_entry_t idefloppy_proc[] = { #endif /* CONFIG_PROC_FS */ -static int ide_floppy_probe(struct device *); +static int ide_floppy_probe(ide_drive_t *); static ide_driver_t idefloppy_driver = { - .owner = THIS_MODULE, .gen_driver = { + .owner = THIS_MODULE, .name = "ide-floppy", .bus = &ide_bus_type, - .probe = ide_floppy_probe, - .remove = ide_floppy_remove, }, + .probe = ide_floppy_probe, + .remove = ide_floppy_remove, .version = IDEFLOPPY_VERSION, .media = ide_floppy, .supports_dsc_overlap = 0, @@ -2031,6 +2028,17 @@ static int idefloppy_release(struct inode *inode, struct file *filp) return 0; } +static int idefloppy_getgeo(struct block_device *bdev, struct hd_geometry *geo) +{ + struct ide_floppy_obj *floppy = ide_floppy_g(bdev->bd_disk); + ide_drive_t *drive = floppy->drive; + + geo->heads = drive->bios_head; + geo->sectors = drive->bios_sect; + geo->cylinders = (u16)drive->bios_cyl; /* truncate */ + return 0; +} + static int idefloppy_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -2120,13 +2128,13 @@ static struct block_device_operations idefloppy_ops = { .open = idefloppy_open, .release = idefloppy_release, .ioctl = idefloppy_ioctl, + .getgeo = idefloppy_getgeo, .media_changed = idefloppy_media_changed, .revalidate_disk= idefloppy_revalidate_disk }; -static int ide_floppy_probe(struct device *dev) +static int ide_floppy_probe(ide_drive_t *drive) { - ide_drive_t *drive = to_ide_device(dev); idefloppy_floppy_t *floppy; struct gendisk *g; @@ -2191,15 +2199,13 @@ static void __exit idefloppy_exit (void) driver_unregister(&idefloppy_driver.gen_driver); } -/* - * idefloppy_init will register the driver for each floppy. - */ -static int idefloppy_init (void) +static int __init idefloppy_init(void) { printk("ide-floppy driver " IDEFLOPPY_VERSION "\n"); return driver_register(&idefloppy_driver.gen_driver); } +MODULE_ALIAS("ide:*m-floppy*"); module_init(idefloppy_init); module_exit(idefloppy_exit); MODULE_LICENSE("GPL");