Skip to content

Commit

Permalink
staging: dt3155: revert u_long to u64 usage
Browse files Browse the repository at this point in the history
Commit 9c1390a923ddb6fba1cf9d7440743369140c6d8a replaced
all u_int's with u32 and u_long's with u64. Unfortunately, a u_long
is still only 32-bits so they should have been replaced with u32 also.

This can be verified by the register definitions in dt3155_io.h.  It
specifically states that the memory mapped registers are 32-bit.

Fix this by changing all the u64 to u32.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 5617f9d commit 3a8954e
Show file tree
Hide file tree
Showing 8 changed files with 151 additions and 151 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/dt3155/allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ int allocator_free_dma(unsigned long address)
* On cleanup everything is released. If the list is not empty, that a
* problem of our clients
*/
int allocator_init(u64 *allocator_max)
int allocator_init(u32 *allocator_max)
{
/* check how much free memory is there */
void *remapped;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/dt3155/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@

void allocator_free_dma(unsigned long address);
unsigned long allocator_allocate_dma(unsigned long kilobytes, int priority);
int allocator_init(u64 *);
int allocator_init(u32 *);
void allocator_cleanup(void);
24 changes: 12 additions & 12 deletions drivers/staging/dt3155/dt3155.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ struct dt3155_config_s {

/* hold data for each frame */
typedef struct {
u64 addr; /* address of the buffer with the frame */
u64 tag; /* unique number for the frame */
u32 addr; /* address of the buffer with the frame */
u32 tag; /* unique number for the frame */
struct timeval time; /* time that capture took place */
} frame_info_t;

Expand All @@ -101,14 +101,14 @@ struct dt3155_fbuffer_s {
int locked_buf; /* Buffers used by user */

int ready_que[BOARD_MAX_BUFFS];
u64 ready_head; /* The most recent buffer located here */
u64 ready_len; /* The number of ready buffers */
u32 ready_head; /* The most recent buffer located here */
u32 ready_len; /* The number of ready buffers */

int even_happened;
int even_stopped;

int stop_acquire; /* Flag to stop interrupts */
u64 frame_count; /* Counter for frames acquired by this card */
u32 frame_count; /* Counter for frames acquired by this card */
};


Expand All @@ -122,13 +122,13 @@ struct dt3155_fbuffer_s {
/* There is one status structure for each card. */
typedef struct dt3155_status_s {
int fixed_mode; /* if 1, we are in fixed frame mode */
u64 reg_addr; /* Register address for a single card */
u64 mem_addr; /* Buffer start addr for this card */
u64 mem_size; /* This is the amount of mem available */
u32 reg_addr; /* Register address for a single card */
u32 mem_addr; /* Buffer start addr for this card */
u32 mem_size; /* This is the amount of mem available */
u32 irq; /* this card's irq */
struct dt3155_config_s config; /* configuration struct */
struct dt3155_fbuffer_s fbuffer; /* frame buffer state struct */
u64 state; /* this card's state */
u32 state; /* this card's state */
u32 device_installed; /* Flag if installed. 1=installed */
} dt3155_status_t;

Expand Down Expand Up @@ -161,9 +161,9 @@ extern struct dt3155_status_s dt3155_status[MAXBOARDS];

/* User code will probably want to declare one of these for each card */
typedef struct dt3155_read_s {
u64 offset;
u64 frame_seq;
u64 state;
u32 offset;
u32 frame_seq;
u32 state;

frame_info_t frame_info;
} dt3155_read_t;
Expand Down
28 changes: 14 additions & 14 deletions drivers/staging/dt3155/dt3155_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ u32 dt3155_dev_open[ MAXBOARDS ] = {0
};

u32 ndevices = 0;
u64 unique_tag = 0;;
u32 unique_tag = 0;;


/*
Expand Down Expand Up @@ -180,7 +180,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
int minor = -1;
int index;
unsigned long flags;
u64 buffer_addr;
u32 buffer_addr;

/* find out who issued the interrupt */
for ( index = 0; index < ndevices; index++ ) {
Expand Down Expand Up @@ -249,7 +249,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
{
/* GCS (Aug 2, 2002) -- In field mode, dma the odd field
into the lower half of the buffer */
const u64 stride = dt3155_status[ minor ].config.cols;
const u32 stride = dt3155_status[ minor ].config.cols;
buffer_addr = dt3155_fbuffer[ minor ]->
frame_info[ dt3155_fbuffer[ minor ]->active_buf ].addr
+ (DT3155_MAX_ROWS / 2) * stride;
Expand Down Expand Up @@ -312,7 +312,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
dt3155_fbuffer[ minor ]->even_stopped = 0;

printk(KERN_DEBUG "dt3155: state is now %x\n",
(u32)dt3155_status[minor].state);
dt3155_status[minor].state);
}
else
{
Expand Down Expand Up @@ -428,7 +428,7 @@ static inline void dt3155_isr( int irq, void *dev_id, struct pt_regs *regs )
*****************************************************/
static void dt3155_init_isr(int minor)
{
const u64 stride = dt3155_status[ minor ].config.cols;
const u32 stride = dt3155_status[ minor ].config.cols;

switch (dt3155_status[ minor ].state & DT3155_STATE_MODE)
{
Expand Down Expand Up @@ -706,7 +706,7 @@ static int dt3155_open( struct inode* inode, struct file* filep)

if (dt3155_status[ minor ].state != DT3155_STATE_IDLE) {
printk ("DT3155: Not in idle state (state = %x)\n",
(u32)dt3155_status[ minor ].state);
dt3155_status[ minor ].state);
return -EBUSY;
}

Expand Down Expand Up @@ -762,7 +762,7 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
{
/* which device are we reading from? */
int minor = MINOR(filep->f_dentry->d_inode->i_rdev);
u64 offset;
u32 offset;
int frame_index;
frame_info_t *frame_info_p;

Expand Down Expand Up @@ -820,11 +820,11 @@ static ssize_t dt3155_read(struct file *filep, char __user *buf,
offset = frame_info_p->addr - dt3155_status[minor].mem_addr;

put_user(offset, (unsigned int *) buf);
buf += sizeof(u64);
buf += sizeof(u32);
put_user( dt3155_status[minor].fbuffer.frame_count, (unsigned int *) buf);
buf += sizeof(u64);
buf += sizeof(u32);
put_user(dt3155_status[minor].state, (unsigned int *) buf);
buf += sizeof(u64);
buf += sizeof(u32);
if (copy_to_user(buf, frame_info_p, sizeof(frame_info_t)))
return -EFAULT;

Expand Down Expand Up @@ -931,7 +931,7 @@ static int find_PCI (void)
dt3155_status[ pci_index-1 ].device_installed = 1;
printk("DT3155: Installing device %d w/irq %d and address %p\n",
pci_index,
(u32)dt3155_status[pci_index-1].irq,
dt3155_status[pci_index-1].irq,
dt3155_lbase[pci_index-1]);

}
Expand All @@ -944,7 +944,7 @@ static int find_PCI (void)
return DT_3155_FAILURE;
}

u64 allocatorAddr = 0;
u32 allocatorAddr = 0;

/*****************************************************
* init_module()
Expand Down Expand Up @@ -1024,9 +1024,9 @@ int init_module(void)
dt3155_status[ index ].config.rows);
printk("DT3155: m_addr = 0x%x; m_size = %ld; "
"state = %d; device_installed = %d\n",
(u32)dt3155_status[ index ].mem_addr,
dt3155_status[ index ].mem_addr,
(long int)dt3155_status[ index ].mem_size,
(u32)dt3155_status[ index ].state,
dt3155_status[ index ].state,
dt3155_status[ index ].device_installed);
}

Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/dt3155/dt3155_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@


/****** local copies of board's 32 bit registers ******/
u64 even_dma_start_r; /* bit 0 should always be 0 */
u64 odd_dma_start_r; /* .. */
u64 even_dma_stride_r; /* bits 0&1 should always be 0 */
u64 odd_dma_stride_r; /* .. */
u64 even_pixel_fmt_r;
u64 odd_pixel_fmt_r;
u32 even_dma_start_r; /* bit 0 should always be 0 */
u32 odd_dma_start_r; /* .. */
u32 even_dma_stride_r; /* bits 0&1 should always be 0 */
u32 odd_dma_stride_r; /* .. */
u32 even_pixel_fmt_r;
u32 odd_pixel_fmt_r;

FIFO_TRIGGER_R fifo_trigger_r;
XFER_MODE_R xfer_mode_r;
CSR1_R csr1_r;
RETRY_WAIT_CNT_R retry_wait_cnt_r;
INT_CSR_R int_csr_r;

u64 even_fld_mask_r;
u64 odd_fld_mask_r;
u32 even_fld_mask_r;
u32 odd_fld_mask_r;

MASK_LENGTH_R mask_length_r;
FIFO_FLAG_CNT_R fifo_flag_cnt_r;
Expand Down
Loading

0 comments on commit 3a8954e

Please sign in to comment.