From 62977e8ea98e99dbf86609e65930e6607398e1c5 Mon Sep 17 00:00:00 2001 From: Finn Thain Date: Fri, 4 Sep 2026 19:26:36 +1000 Subject: [PATCH] swim: Refactor SWIM setup The write to the setup register is really chip initialization, so do it in swim_floppy_init() rather than floppy_open(). Drop the udelay(), which was apparently copied and pasted from swim3.c where it presumably relates to interrupts, of which this chip has none. (See also mkLinux SWIM 3 driver.) Cc: Joshua Thompson Signed-off-by: Finn Thain Tested-by: Stan Johnson Link: https://patch.msgid.link/e9facb07b20436a6941ec067288e84d8dd9311c0.1788513997.git.fthain@linux-m68k.org Signed-off-by: Jens Axboe --- drivers/block/swim.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/block/swim.c b/drivers/block/swim.c index c2d7ad3f065c..b8384525fc9a 100644 --- a/drivers/block/swim.c +++ b/drivers/block/swim.c @@ -628,8 +628,7 @@ static int floppy_open(struct gendisk *disk, blk_mode_t mode) fs->ref_count = -1; else fs->ref_count++; - swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2); - udelay(10); + swim_drive(base, fs->location); swim_motor(base, ON); swim_action(base, SETMFM); @@ -816,6 +815,8 @@ static int swim_floppy_init(struct swim_priv *swd) int drive; struct swim __iomem *base = swd->base; + swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2); + swim_set_parameters(base); /* scan floppy drives */