Skip to content

Commit

Permalink
floppy: handle device_create_file() failure while init
Browse files Browse the repository at this point in the history
This patch kills the "ignoring return value of 'device_create_file'"
warning message.

Signed-off-by: Monakhov Dmitriy <dmonakhov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dmitriy Monakhov authored and Linus Torvalds committed May 8, 2007
1 parent 6de2d20 commit 4ea1b0f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -4334,7 +4334,10 @@ static int __init floppy_init(void)
if (err)
goto out_flush_work;

device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
err = device_create_file(&floppy_device[drive].dev,&dev_attr_cmos);
if (err)
goto out_unreg_platform_dev;

/* to be cleaned up... */
disks[drive]->private_data = (void *)(long)drive;
disks[drive]->queue = floppy_queue;
Expand All @@ -4345,6 +4348,8 @@ static int __init floppy_init(void)

return 0;

out_unreg_platform_dev:
platform_device_unregister(&floppy_device[drive]);
out_flush_work:
flush_scheduled_work();
if (usage_count)
Expand Down

0 comments on commit 4ea1b0f

Please sign in to comment.