Commit a03beaef authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 13)

 - Atari joystick device number updates
 - Atari ACSI hard disk driver device updates
 - Atari floppy driver device updates
 - MVME147 serial driver dev_t update
parent b8c4b42d
......@@ -22,8 +22,8 @@
#define MAJOR_NR JOYSTICK_MAJOR
#define ANALOG_JOY(n) (!(n & 0x80))
#define DIGITAL_JOY(n) (n & 0x80)
#define DEVICE_NR(n) (MINOR(n) & 0x7f)
#define DIGITAL_JOY(n) (minor(n) & 0x80)
#define DEVICE_NR(n) (minor(n) & 0x7f)
static struct joystick_status joystick[2];
......
......@@ -68,6 +68,7 @@ typedef void Scsi_Device; /* hack to avoid including scsi.h */
#include <scsi/scsi_ioctl.h>
#include <linux/hdreg.h> /* for HDIO_GETGEO */
#include <linux/blkpg.h>
#include <linux/buffer_head.h>
#include <asm/setup.h>
#include <asm/pgtable.h>
......@@ -372,13 +373,13 @@ static void acsi_prevent_removal( int target, int flag );
static int acsi_change_blk_size( int target, int lun);
static int acsi_mode_sense( int target, int lun, SENSE_DATA *sd );
static void acsi_geninit(void);
static int revalidate_acsidisk( int dev, int maxusage );
static int acsi_revalidate (dev_t);
static int revalidate_acsidisk( kdev_t dev, int maxusage );
static int acsi_revalidate (kdev_t);
/************************* End of Prototypes **************************/
struct timer_list acsi_timer = { NULL, NULL, 0, 0, acsi_times_out };
struct timer_list acsi_timer = { function: acsi_times_out };
#ifdef CONFIG_ATARI_SLM
......@@ -786,7 +787,7 @@ static void read_intr( void )
status = acsi_getstatus();
if (status != 0) {
int dev = DEVICE_NR(minor(CURRENT->rq_dev));
int dev = minor(CURRENT->rq_dev);
printk( KERN_ERR "ad%c: ", dev+'a' );
if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target,
acsi_info[dev].lun))
......@@ -817,7 +818,7 @@ static void write_intr(void)
status = acsi_getstatus();
if (status != 0) {
int dev = DEVICE_NR(minor(CURRENT->rq_dev));
int dev = minor(CURRENT->rq_dev);
printk( KERN_ERR "ad%c: ", dev+'a' );
if (!acsi_reqsense( acsi_buffer, acsi_info[dev].target,
acsi_info[dev].lun))
......@@ -969,7 +970,7 @@ static void redo_acsi_request( void )
return;
}
if (MAJOR(CURRENT->rq_dev) != MAJOR_NR)
if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
if (CURRENT->bh) {
if (!CURRENT->bh && !buffer_locked(CURRENT->bh))
......@@ -978,26 +979,26 @@ static void redo_acsi_request( void )
dev = minor(CURRENT->rq_dev);
block = CURRENT->sector;
if (DEVICE_NR(dev) >= NDevices ||
if (dev >= NDevices ||
block+CURRENT->nr_sectors >= acsi_part[dev].nr_sects) {
#ifdef DEBUG
printk( "ad%c: attempted access for blocks %d...%ld past end of device at block %ld.\n",
DEVICE_NR(dev)+'a',
dev+'a',
block, block + CURRENT->nr_sectors - 1,
acsi_part[dev].nr_sects);
#endif
end_request(CURRENT, 0);
goto repeat;
}
if (acsi_info[DEVICE_NR(dev)].changed) {
if (acsi_info[dev].changed) {
printk( KERN_NOTICE "ad%c: request denied because cartridge has "
"been changed.\n", DEVICE_NR(dev)+'a' );
"been changed.\n", dev+'a' );
end_request(CURRENT, 0);
goto repeat;
}
target = acsi_info[DEVICE_NR(dev)].target;
lun = acsi_info[DEVICE_NR(dev)].lun;
target = acsi_info[dev].target;
lun = acsi_info[dev].lun;
/* Find out how many sectors should be transferred from/to
* consecutive buffers and thus can be done with a single command.
......@@ -1045,7 +1046,7 @@ static void redo_acsi_request( void )
CurrentBuffer = buffer;
CurrentNSect = nsect;
if (CURRENT->cmd == WRITE) {
if (rq_data_dir(CURRENT) == WRITE) {
CMDSET_TARG_LUN( write_cmd, target, lun );
CMDSET_BLOCK( write_cmd, block );
CMDSET_LEN( write_cmd, nsect );
......@@ -1062,7 +1063,7 @@ static void redo_acsi_request( void )
SET_TIMER();
return;
}
if (CURRENT->cmd == READ) {
if (rq_data_dir(CURRENT) == READ) {
CMDSET_TARG_LUN( read_cmd, target, lun );
CMDSET_BLOCK( read_cmd, block );
CMDSET_LEN( read_cmd, nsect );
......@@ -1090,11 +1091,12 @@ static void redo_acsi_request( void )
static int acsi_ioctl( struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg )
{ int dev;
{
dev_t dev;
if (!inode)
return -EINVAL;
dev = DEVICE_NR(minor(inode->i_rdev));
dev = minor(inode->i_rdev);
if (dev >= NDevices)
return -EINVAL;
switch (cmd) {
......@@ -1157,7 +1159,7 @@ static int acsi_open( struct inode * inode, struct file * filp )
int device;
struct acsi_info_struct *aip;
device = DEVICE_NR(minor(inode->i_rdev));
device = minor(inode->i_rdev);
if (device >= NDevices)
return -ENXIO;
aip = &acsi_info[device];
......@@ -1195,7 +1197,7 @@ static int acsi_open( struct inode * inode, struct file * filp )
static int acsi_release( struct inode * inode, struct file * file )
{
int device = DEVICE_NR(minor(inode->i_rdev));
int device = minor(inode->i_rdev);
if (--access_count[device] == 0 && acsi_info[device].removable)
acsi_prevent_removal(device, 0);
return( 0 );
......@@ -1221,9 +1223,9 @@ static void acsi_prevent_removal(int device, int flag)
stdma_release();
}
static int acsi_media_change (dev_t dev)
static int acsi_media_change (kdev_t dev)
{
int device = DEVICE_NR(minor(dev));
int device = minor(dev);
struct acsi_info_struct *aip;
aip = &acsi_info[device];
......@@ -1826,14 +1828,14 @@ void cleanup_module(void)
*
*/
static int revalidate_acsidisk( int dev, int maxusage )
static int revalidate_acsidisk(kdev_t dev, int maxusage )
{
int device;
struct gendisk * gdev;
int res;
struct acsi_info_struct *aip;
device = DEVICE_NR(minor(dev));
device = minor(dev);
aip = &acsi_info[device];
gdev = &GENDISK_STRUCT;
......@@ -1870,7 +1872,7 @@ static int revalidate_acsidisk( int dev, int maxusage )
}
static int acsi_revalidate (dev_t dev)
static int acsi_revalidate (kdev_t dev)
{
return revalidate_acsidisk (dev, 0);
}
......@@ -71,6 +71,7 @@
#include <linux/amifdreg.h>
#include <linux/amifd.h>
#include <linux/ioport.h>
#include <linux/buffer_head.h>
#include <asm/setup.h>
#include <asm/uaccess.h>
......@@ -1849,8 +1850,6 @@ int __init amiga_floppy_init(void)
/* init ms timer */
ciaa.crb = 8; /* one-shot, stop */
(void)do_floppy; /* avoid warning about unused variable */
return 0;
}
......
......@@ -76,6 +76,7 @@
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/buffer_head.h> /* for invalidate_buffers() */
#include <asm/setup.h>
#include <asm/system.h>
......@@ -358,7 +359,7 @@ static void fd_select_side( int side );
static void fd_select_drive( int drive );
static void fd_deselect( void );
static void fd_motor_off_timer( unsigned long dummy );
static void check_change( void );
static void check_change( unsigned long dummy );
static __inline__ void set_head_settle_flag( void );
static __inline__ int get_head_settle_flag( void );
static void floppy_irq (int irq, void *dummy, struct pt_regs *fp);
......@@ -378,7 +379,6 @@ static void fd_writetrack_done( int status );
static void fd_times_out( unsigned long dummy );
static void finish_fdc( void );
static void finish_fdc_done( int dummy );
static void floppy_off( unsigned int nr);
static __inline__ void copy_buffer( void *from, void *to);
static void setup_req_params( int drive );
static void redo_fd_request( void);
......@@ -539,7 +539,7 @@ static void fd_motor_off_timer( unsigned long dummy )
* as possible) and keep track of the current state of the write protection.
*/
static void check_change( void )
static void check_change( unsigned long dummy )
{
static int drive = 0;
......@@ -1339,9 +1339,6 @@ static void finish_fdc_done( int dummy )
static int fd_ref[4] = { 0,0,0,0 };
static int fd_device[4] = { 0,0,0,0 };
/* dummy for blk.h */
static void floppy_off( unsigned int nr) {}
/* The detection of disk changes is a dark chapter in Atari history :-(
* Because the "Drive ready" signal isn't present in the Atari
......@@ -1458,9 +1455,6 @@ static void redo_fd_request(void)
if (major(CURRENT->rq_dev) != MAJOR_NR)
panic(DEVICE_NAME ": request list destroyed");
if (CURRENT->bh && !buffer_locked(CURRENT->bh))
panic(DEVICE_NAME ": block not locked");
device = minor(CURRENT->rq_dev);
drive = device & 3;
type = device >> 2;
......@@ -1507,7 +1501,7 @@ static void redo_fd_request(void)
del_timer( &motor_off_timer );
ReqCnt = 0;
ReqCmd = CURRENT->cmd;
ReqCmd = rq_data_dir(CURRENT);
ReqBlock = CURRENT->sector;
ReqBuffer = CURRENT->buffer;
setup_req_params( drive );
......@@ -2008,7 +2002,6 @@ int __init atari_floppy_init (void)
UseTrackbuffer ? "" : "no ");
config_types();
(void)do_floppy; /* avoid warning about unused variable */
return 0;
}
......
......@@ -237,8 +237,8 @@ void my_udelay (long us)
}
static inline int
serial_paranoia_check(struct cyclades_port *info,
dev_t device, const char *routine)
serial_paranoia_check(struct cyclades_port *info, kdev_t device,
const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
static const char *badmagic =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment