aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/uio/uio.c14
-rw-r--r--include/linux/uio_driver.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 8132288920b2..0fd2cda74244 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -512,7 +512,7 @@ static unsigned int uio_poll(struct file *filep, poll_table *wait)
512 struct uio_listener *listener = filep->private_data; 512 struct uio_listener *listener = filep->private_data;
513 struct uio_device *idev = listener->dev; 513 struct uio_device *idev = listener->dev;
514 514
515 if (idev->info->irq == UIO_IRQ_NONE) 515 if (!idev->info->irq)
516 return -EIO; 516 return -EIO;
517 517
518 poll_wait(filep, &idev->wait, wait); 518 poll_wait(filep, &idev->wait, wait);
@@ -530,7 +530,7 @@ static ssize_t uio_read(struct file *filep, char __user *buf,
530 ssize_t retval; 530 ssize_t retval;
531 s32 event_count; 531 s32 event_count;
532 532
533 if (idev->info->irq == UIO_IRQ_NONE) 533 if (!idev->info->irq)
534 return -EIO; 534 return -EIO;
535 535
536 if (count != sizeof(s32)) 536 if (count != sizeof(s32))
@@ -578,7 +578,7 @@ static ssize_t uio_write(struct file *filep, const char __user *buf,
578 ssize_t retval; 578 ssize_t retval;
579 s32 irq_on; 579 s32 irq_on;
580 580
581 if (idev->info->irq == UIO_IRQ_NONE) 581 if (!idev->info->irq)
582 return -EIO; 582 return -EIO;
583 583
584 if (count != sizeof(s32)) 584 if (count != sizeof(s32))
@@ -825,9 +825,9 @@ int __uio_register_device(struct module *owner,
825 825
826 info->uio_dev = idev; 826 info->uio_dev = idev;
827 827
828 if (idev->info->irq >= 0) { 828 if (info->irq && (info->irq != UIO_IRQ_CUSTOM)) {
829 ret = request_irq(idev->info->irq, uio_interrupt, 829 ret = request_irq(info->irq, uio_interrupt,
830 idev->info->irq_flags, idev->info->name, idev); 830 info->irq_flags, info->name, idev);
831 if (ret) 831 if (ret)
832 goto err_request_irq; 832 goto err_request_irq;
833 } 833 }
@@ -863,7 +863,7 @@ void uio_unregister_device(struct uio_info *info)
863 863
864 uio_free_minor(idev); 864 uio_free_minor(idev);
865 865
866 if (info->irq >= 0) 866 if (info->irq && (info->irq != UIO_IRQ_CUSTOM))
867 free_irq(info->irq, idev); 867 free_irq(info->irq, idev);
868 868
869 uio_dev_del_attributes(idev); 869 uio_dev_del_attributes(idev);
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 5dcc9ff72f69..d6188e5a52df 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -108,7 +108,7 @@ extern void uio_event_notify(struct uio_info *info);
108 108
109/* defines for uio_info->irq */ 109/* defines for uio_info->irq */
110#define UIO_IRQ_CUSTOM -1 110#define UIO_IRQ_CUSTOM -1
111#define UIO_IRQ_NONE -2 111#define UIO_IRQ_NONE 0
112 112
113/* defines for uio_mem->memtype */ 113/* defines for uio_mem->memtype */
114#define UIO_MEM_NONE 0 114#define UIO_MEM_NONE 0