Skip to content

Commit

Permalink
block: floppy: fix rmmod lockup
Browse files Browse the repository at this point in the history
Floppy rmmod locks up when no such hardware was initialized, since there is
nobody to wake the remove code up.  Remove the completion, because release is
called during platform_unregister anyway.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jiri Slaby authored and Linus Torvalds committed Mar 13, 2008
1 parent bd0e88e commit f2005e1
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/block/floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ static int use_virtual_dma;
*/

static DEFINE_SPINLOCK(floppy_lock);
static struct completion device_release;

static unsigned short virtual_dma_port = 0x3f0;
irqreturn_t floppy_interrupt(int irq, void *dev_id);
Expand Down Expand Up @@ -4144,7 +4143,6 @@ DEVICE_ATTR(cmos,S_IRUGO,floppy_cmos_show,NULL);

static void floppy_device_release(struct device *dev)
{
complete(&device_release);
}

static struct platform_device floppy_device[N_DRIVE];
Expand Down Expand Up @@ -4539,7 +4537,6 @@ void cleanup_module(void)
{
int drive;

init_completion(&device_release);
blk_unregister_region(MKDEV(FLOPPY_MAJOR, 0), 256);
unregister_blkdev(FLOPPY_MAJOR, "fd");

Expand All @@ -4564,8 +4561,6 @@ void cleanup_module(void)

/* eject disk, if any */
fd_eject(0);

wait_for_completion(&device_release);
}

module_param(floppy, charp, 0);
Expand Down

0 comments on commit f2005e1

Please sign in to comment.