Re: [PATCH 02/31] swim: Select appropriate drive once only

Laurent Vivier <[email protected]>
Newsgroups org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k
Message-ID <[email protected]>
Le 16/07/2026 à 12:02, Finn Thain a écrit :
> 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 <[email protected]>
> ---
>   drivers/block/swim.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)


Reviewed-by: Laurent Vivier <[email protected]>

> 
> 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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.