diff --git a/src/wz_dma.c b/src/wz_dma.c index 5a4dedba193b897eb61350548e2b914307105680..c2f18d5cafad42c6e63336eb999413dad3e1c46e 100644 --- a/src/wz_dma.c +++ b/src/wz_dma.c @@ -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); diff --git a/src/wz_dma.h b/src/wz_dma.h index 01844c4340ced75ec9cbfd36bedc1a3afc74d2e5..2fe79239645a06ce990b476ab918c7736575f2e6 100644 --- a/src/wz_dma.h +++ b/src/wz_dma.h @@ -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; };