aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/swim3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/swim3.c')
-rw-r--r--drivers/block/swim3.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 5b09cf154ac7..e5f7494c00ee 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -253,7 +253,7 @@ static int floppy_revalidate(struct gendisk *disk);
253static int swim3_add_device(struct device_node *swims); 253static int swim3_add_device(struct device_node *swims);
254int swim3_init(void); 254int swim3_init(void);
255 255
256#ifndef CONFIG_PMAC_PBOOK 256#ifndef CONFIG_PMAC_MEDIABAY
257#define check_media_bay(which, what) 1 257#define check_media_bay(which, what) 1
258#endif 258#endif
259 259
@@ -297,9 +297,11 @@ static void do_fd_request(request_queue_t * q)
297 int i; 297 int i;
298 for(i=0;i<floppy_count;i++) 298 for(i=0;i<floppy_count;i++)
299 { 299 {
300#ifdef CONFIG_PMAC_MEDIABAY
300 if (floppy_states[i].media_bay && 301 if (floppy_states[i].media_bay &&
301 check_media_bay(floppy_states[i].media_bay, MB_FD)) 302 check_media_bay(floppy_states[i].media_bay, MB_FD))
302 continue; 303 continue;
304#endif /* CONFIG_PMAC_MEDIABAY */
303 start_request(&floppy_states[i]); 305 start_request(&floppy_states[i]);
304 } 306 }
305 sti(); 307 sti();
@@ -856,8 +858,10 @@ static int floppy_ioctl(struct inode *inode, struct file *filp,
856 if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN)) 858 if ((cmd & 0x80) && !capable(CAP_SYS_ADMIN))
857 return -EPERM; 859 return -EPERM;
858 860
861#ifdef CONFIG_PMAC_MEDIABAY
859 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD)) 862 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
860 return -ENXIO; 863 return -ENXIO;
864#endif
861 865
862 switch (cmd) { 866 switch (cmd) {
863 case FDEJECT: 867 case FDEJECT:
@@ -881,8 +885,10 @@ static int floppy_open(struct inode *inode, struct file *filp)
881 int n, err = 0; 885 int n, err = 0;
882 886
883 if (fs->ref_count == 0) { 887 if (fs->ref_count == 0) {
888#ifdef CONFIG_PMAC_MEDIABAY
884 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD)) 889 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
885 return -ENXIO; 890 return -ENXIO;
891#endif
886 out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2); 892 out_8(&sw->setup, S_IBM_DRIVE | S_FCLK_DIV2);
887 out_8(&sw->control_bic, 0xff); 893 out_8(&sw->control_bic, 0xff);
888 out_8(&sw->mode, 0x95); 894 out_8(&sw->mode, 0x95);
@@ -967,8 +973,10 @@ static int floppy_revalidate(struct gendisk *disk)
967 struct swim3 __iomem *sw; 973 struct swim3 __iomem *sw;
968 int ret, n; 974 int ret, n;
969 975
976#ifdef CONFIG_PMAC_MEDIABAY
970 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD)) 977 if (fs->media_bay && check_media_bay(fs->media_bay, MB_FD))
971 return -ENXIO; 978 return -ENXIO;
979#endif
972 980
973 sw = fs->swim3; 981 sw = fs->swim3;
974 grab_drive(fs, revalidating, 0); 982 grab_drive(fs, revalidating, 0);