Before turning off the spindle motor, call swim_drive() to select the appropriate drive. Remove the swim_drive() call from swim_add_floppy() because it was already called by swim_floppy_init(). Fixes: 8852ecd97488 ("m68k: mac - Add SWIM floppy support") Signed-off-by: Finn Thain --- drivers/block/swim.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index b61e92d0e3e9..2c52a210f4a6 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -679,8 +679,10 @@ static void floppy_release(struct gendisk *disk) else if (fs->ref_count > 0) --fs->ref_count; - if (fs->ref_count == 0) + if (fs->ref_count == 0) { + swim_drive(base, fs->location); swim_motor(base, OFF); + } mutex_unlock(&swim_mutex); } @@ -752,8 +754,6 @@ static int swim_add_floppy(struct swim_priv *swd, enum drive_location location) fs->location = location; - swim_drive(base, location); - swim_motor(base, OFF); fs->type = HD_MEDIA; -- 2.52.0