swim3.c (d32e2bf83791727a84ad5d3e3d713e82f9adbe30) swim3.c (ae220766d87cd6799dbf918fea10613ae14c0654)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Driver for the SWIM3 (Super Woz Integrated Machine 3)
4 * floppy controller found on Power Macintoshes.
5 *
6 * Copyright (C) 1996 Paul Mackerras.
7 */
8

--- 235 unchanged lines hidden (view full) ---

244/*static void fd_dma_interrupt(int irq, void *dev_id);*/
245static int grab_drive(struct floppy_state *fs, enum swim_state state,
246 int interruptible);
247static void release_drive(struct floppy_state *fs);
248static int fd_eject(struct floppy_state *fs);
249static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
250 unsigned int cmd, unsigned long param);
251static int floppy_open(struct gendisk *disk, fmode_t mode);
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 * Driver for the SWIM3 (Super Woz Integrated Machine 3)
4 * floppy controller found on Power Macintoshes.
5 *
6 * Copyright (C) 1996 Paul Mackerras.
7 */
8

--- 235 unchanged lines hidden (view full) ---

244/*static void fd_dma_interrupt(int irq, void *dev_id);*/
245static int grab_drive(struct floppy_state *fs, enum swim_state state,
246 int interruptible);
247static void release_drive(struct floppy_state *fs);
248static int fd_eject(struct floppy_state *fs);
249static int floppy_ioctl(struct block_device *bdev, fmode_t mode,
250 unsigned int cmd, unsigned long param);
251static int floppy_open(struct gendisk *disk, fmode_t mode);
252static void floppy_release(struct gendisk *disk, fmode_t mode);
253static unsigned int floppy_check_events(struct gendisk *disk,
254 unsigned int clearing);
255static int floppy_revalidate(struct gendisk *disk);
256
257static bool swim3_end_request(struct floppy_state *fs, blk_status_t err, unsigned int nr_bytes)
258{
259 struct request *req = fs->cur_req;
260

--- 738 unchanged lines hidden (view full) ---

999
1000 mutex_lock(&swim3_mutex);
1001 ret = floppy_open(bdev, mode);
1002 mutex_unlock(&swim3_mutex);
1003
1004 return ret;
1005}
1006
252static unsigned int floppy_check_events(struct gendisk *disk,
253 unsigned int clearing);
254static int floppy_revalidate(struct gendisk *disk);
255
256static bool swim3_end_request(struct floppy_state *fs, blk_status_t err, unsigned int nr_bytes)
257{
258 struct request *req = fs->cur_req;
259

--- 738 unchanged lines hidden (view full) ---

998
999 mutex_lock(&swim3_mutex);
1000 ret = floppy_open(bdev, mode);
1001 mutex_unlock(&swim3_mutex);
1002
1003 return ret;
1004}
1005
1007static void floppy_release(struct gendisk *disk, fmode_t mode)
1006static void floppy_release(struct gendisk *disk)
1008{
1009 struct floppy_state *fs = disk->private_data;
1010 struct swim3 __iomem *sw = fs->swim3;
1011
1012 mutex_lock(&swim3_mutex);
1013 if (fs->ref_count > 0)
1014 --fs->ref_count;
1015 else if (fs->ref_count == -1)

--- 276 unchanged lines hidden ---
1007{
1008 struct floppy_state *fs = disk->private_data;
1009 struct swim3 __iomem *sw = fs->swim3;
1010
1011 mutex_lock(&swim3_mutex);
1012 if (fs->ref_count > 0)
1013 --fs->ref_count;
1014 else if (fs->ref_count == -1)

--- 276 unchanged lines hidden ---