|
@@ -4112,6 +4112,13 @@ static ssize_t floppy_cmos_show(struct device *dev,
|
|
|
|
|
|
static DEVICE_ATTR(cmos, S_IRUGO, floppy_cmos_show, NULL);
|
|
static DEVICE_ATTR(cmos, S_IRUGO, floppy_cmos_show, NULL);
|
|
|
|
|
|
|
|
+static struct attribute *floppy_dev_attrs[] = {
|
|
|
|
+ &dev_attr_cmos.attr,
|
|
|
|
+ NULL
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+ATTRIBUTE_GROUPS(floppy_dev);
|
|
|
|
+
|
|
static void floppy_device_release(struct device *dev)
|
|
static void floppy_device_release(struct device *dev)
|
|
{
|
|
{
|
|
}
|
|
}
|
|
@@ -4324,16 +4331,12 @@ static int __init do_floppy_init(void)
|
|
floppy_device[drive].name = floppy_device_name;
|
|
floppy_device[drive].name = floppy_device_name;
|
|
floppy_device[drive].id = drive;
|
|
floppy_device[drive].id = drive;
|
|
floppy_device[drive].dev.release = floppy_device_release;
|
|
floppy_device[drive].dev.release = floppy_device_release;
|
|
|
|
+ floppy_device[drive].dev.groups = floppy_dev_groups;
|
|
|
|
|
|
err = platform_device_register(&floppy_device[drive]);
|
|
err = platform_device_register(&floppy_device[drive]);
|
|
if (err)
|
|
if (err)
|
|
goto out_remove_drives;
|
|
goto out_remove_drives;
|
|
|
|
|
|
- err = device_create_file(&floppy_device[drive].dev,
|
|
|
|
- &dev_attr_cmos);
|
|
|
|
- if (err)
|
|
|
|
- goto out_unreg_platform_dev;
|
|
|
|
-
|
|
|
|
/* to be cleaned up... */
|
|
/* to be cleaned up... */
|
|
disks[drive]->private_data = (void *)(long)drive;
|
|
disks[drive]->private_data = (void *)(long)drive;
|
|
disks[drive]->flags |= GENHD_FL_REMOVABLE;
|
|
disks[drive]->flags |= GENHD_FL_REMOVABLE;
|
|
@@ -4343,13 +4346,10 @@ static int __init do_floppy_init(void)
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
-out_unreg_platform_dev:
|
|
|
|
- platform_device_unregister(&floppy_device[drive]);
|
|
|
|
out_remove_drives:
|
|
out_remove_drives:
|
|
while (drive--) {
|
|
while (drive--) {
|
|
if (floppy_available(drive)) {
|
|
if (floppy_available(drive)) {
|
|
del_gendisk(disks[drive]);
|
|
del_gendisk(disks[drive]);
|
|
- device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
|
|
|
|
platform_device_unregister(&floppy_device[drive]);
|
|
platform_device_unregister(&floppy_device[drive]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -4594,7 +4594,6 @@ static void __exit floppy_module_exit(void)
|
|
|
|
|
|
if (floppy_available(drive)) {
|
|
if (floppy_available(drive)) {
|
|
del_gendisk(disks[drive]);
|
|
del_gendisk(disks[drive]);
|
|
- device_remove_file(&floppy_device[drive].dev, &dev_attr_cmos);
|
|
|
|
platform_device_unregister(&floppy_device[drive]);
|
|
platform_device_unregister(&floppy_device[drive]);
|
|
}
|
|
}
|
|
blk_cleanup_queue(disks[drive]->queue);
|
|
blk_cleanup_queue(disks[drive]->queue);
|