Skip to content
Snippets Groups Projects
Commit 168cd421 authored by Petr Zejdl's avatar Petr Zejdl
Browse files

Fixing the inconsistency in the variable names

parent fb20c075
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,10 @@
/*
* Open necessary devices and map DMAable memory.
* Variable user_regs_size is the size (in power of 2) of the user memory space that should be allocated for I/O communication with the hardware.
* Variable usr_regs_size is the size (in power of 2) of the user memory space that should be allocated for I/O communication with the hardware.
* Set to 0 if not necessary.
*/
int wz_init(struct wz_private* wz, size_t user_regs_size)
int wz_init(struct wz_private* wz, size_t usr_regs_size)
{
int res;
......@@ -28,7 +28,7 @@ int wz_init(struct wz_private* wz, size_t user_regs_size)
wz->fd_control = -1;
wz->fd_memory = -1;
wz->fd_memory_is_allocated = 0;
wz->user_regs_size = user_regs_size;
wz->usr_regs_size = usr_regs_size;
wz->usr_regs = NULL;
wz->data_buf = NULL;
......@@ -62,7 +62,7 @@ int wz_init(struct wz_private* wz, size_t user_regs_size)
wz->fd_memory_is_allocated = 1;
//Now mmap the user registers
if (user_regs_size && ((wz->usr_regs = (volatile uint32_t *) mmap(NULL, wz->user_regs_size, PROT_READ | PROT_WRITE, MAP_SHARED, wz->fd_user, 0)) == MAP_FAILED)) {
if (wz->usr_regs_size && ((wz->usr_regs = (volatile uint32_t *) mmap(NULL, wz->usr_regs_size, PROT_READ | PROT_WRITE, MAP_SHARED, wz->fd_user, 0)) == MAP_FAILED)) {
wz->usr_regs = NULL;
PERROR("Can't mmap user registers");
wz_close(wz);
......@@ -95,7 +95,7 @@ int wz_close(struct wz_private* wz)
munmap((void *)wz->data_buf, TOT_BUF_LEN);
}
if (wz->usr_regs) {
munmap((void *)wz->usr_regs, wz->user_regs_size);
munmap((void *)wz->usr_regs, wz->usr_regs_size);
}
if (wz->fd_memory_is_allocated) {
ioctl(wz->fd_memory, IOCTL_XDMA_WZ_FREE_BUFFERS, 0L);
......
......@@ -12,7 +12,7 @@ struct wz_private {
int fd_control;
int fd_memory;
int fd_memory_is_allocated;
size_t user_regs_size;
size_t usr_regs_size;
volatile uint32_t *usr_regs;
volatile char *data_buf;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment