diff options
-rw-r--r-- | pci.c | 5 | ||||
-rw-r--r-- | private_data.h | 4 | ||||
-rw-r--r-- | surface.c | 8 |
3 files changed, 8 insertions, 9 deletions
@@ -20,7 +20,6 @@ irqreturn_t doom_irq(int irq, void *dev) uint32_t interrupts; struct doom_data *doom_data; - doom_data = dev; interrupts = get_interrupts(doom_data->iomem); @@ -59,8 +58,8 @@ int init_pci(struct pci_dev *dev) pci_set_dma_mask(dev, DMA_BIT_MASK(32)); pci_set_consistent_dma_mask(dev, DMA_BIT_MASK(32)); - mutex_init(&doom_data->mutex); - sema_init(&doom_data->ping_sem, 1); + mutex_init(&doom_data->cmd_mutex); + mutex_init(&doom_data->ping_mutex); sema_init(&doom_data->pong_sem, 0); ORFAIL(request_irq(dev->irq, doom_irq, IRQF_SHARED, diff --git a/private_data.h b/private_data.h index 39ceba8..0325b93 100644 --- a/private_data.h +++ b/private_data.h @@ -9,8 +9,8 @@ struct doom_data { struct device *device; struct device *pci_device; void __iomem *iomem; - struct mutex mutex; - struct semaphore ping_sem; + struct mutex cmd_mutex; + struct mutex ping_mutex; struct semaphore pong_sem; }; @@ -22,13 +22,13 @@ long draw_lines(struct file *filp, unsigned long arg) param = (struct doomdev_surf_ioctl_draw_lines *) arg; lines = (struct doomdev_line *) param->lines_ptr; - mutex_lock(&surface_data->doom_data->mutex); + mutex_lock(&surface_data->doom_data->cmd_mutex); for (i = 0; i < param->lines_num; i++) { draw_line(surface_data, lines[i]); } - mutex_unlock(&surface_data->doom_data->mutex); + mutex_unlock(&surface_data->doom_data->cmd_mutex); return param->lines_num; } @@ -58,7 +58,7 @@ ssize_t surface_read(struct file *filp, char __user *buf, size_t count, count = surface_data->surface_size - *offset; } - mutex_lock(&surface_data->doom_data->mutex); + mutex_lock(&surface_data->doom_data->ping_mutex); ping_sync(surface_data->doom_data->iomem); down(&surface_data->doom_data->pong_sem); @@ -68,7 +68,7 @@ ssize_t surface_read(struct file *filp, char __user *buf, size_t count, *offset += count - not_written; - mutex_unlock(&surface_data->doom_data->mutex); + mutex_unlock(&surface_data->doom_data->ping_mutex); return count - not_written; } |