diff options
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/lirc/lirc_serial.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/staging/media/lirc/lirc_serial.c b/drivers/staging/media/lirc/lirc_serial.c index befe6267d7cb..6f5257e68724 100644 --- a/drivers/staging/media/lirc/lirc_serial.c +++ b/drivers/staging/media/lirc/lirc_serial.c | |||
@@ -773,7 +773,7 @@ static int hardware_init_port(void) | |||
773 | /* we fail, there's nothing here */ | 773 | /* we fail, there's nothing here */ |
774 | printk(KERN_ERR LIRC_DRIVER_NAME ": port existence test " | 774 | printk(KERN_ERR LIRC_DRIVER_NAME ": port existence test " |
775 | "failed, cannot continue\n"); | 775 | "failed, cannot continue\n"); |
776 | return -EINVAL; | 776 | return -ENODEV; |
777 | } | 777 | } |
778 | 778 | ||
779 | 779 | ||
@@ -879,10 +879,9 @@ static int __devinit lirc_serial_probe(struct platform_device *dev) | |||
879 | goto exit_free_irq; | 879 | goto exit_free_irq; |
880 | } | 880 | } |
881 | 881 | ||
882 | if (hardware_init_port() < 0) { | 882 | result = hardware_init_port(); |
883 | result = -EINVAL; | 883 | if (result < 0) |
884 | goto exit_release_region; | 884 | goto exit_release_region; |
885 | } | ||
886 | 885 | ||
887 | /* Initialize pulse/space widths */ | 886 | /* Initialize pulse/space widths */ |
888 | init_timing_params(duty_cycle, freq); | 887 | init_timing_params(duty_cycle, freq); |
@@ -980,7 +979,7 @@ static ssize_t lirc_write(struct file *file, const char *buf, | |||
980 | int *wbuf; | 979 | int *wbuf; |
981 | 980 | ||
982 | if (!(hardware[type].features & LIRC_CAN_SEND_PULSE)) | 981 | if (!(hardware[type].features & LIRC_CAN_SEND_PULSE)) |
983 | return -EBADF; | 982 | return -EPERM; |
984 | 983 | ||
985 | count = n / sizeof(int); | 984 | count = n / sizeof(int); |
986 | if (n % sizeof(int) || count % 2 == 0) | 985 | if (n % sizeof(int) || count % 2 == 0) |
@@ -1031,11 +1030,11 @@ static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) | |||
1031 | return result; | 1030 | return result; |
1032 | /* only LIRC_MODE_PULSE supported */ | 1031 | /* only LIRC_MODE_PULSE supported */ |
1033 | if (value != LIRC_MODE_PULSE) | 1032 | if (value != LIRC_MODE_PULSE) |
1034 | return -ENOSYS; | 1033 | return -EINVAL; |
1035 | break; | 1034 | break; |
1036 | 1035 | ||
1037 | case LIRC_GET_LENGTH: | 1036 | case LIRC_GET_LENGTH: |
1038 | return -ENOSYS; | 1037 | return -ENOIOCTLCMD; |
1039 | break; | 1038 | break; |
1040 | 1039 | ||
1041 | case LIRC_SET_SEND_DUTY_CYCLE: | 1040 | case LIRC_SET_SEND_DUTY_CYCLE: |
@@ -1126,9 +1125,11 @@ static void lirc_serial_exit(void); | |||
1126 | static int lirc_serial_resume(struct platform_device *dev) | 1125 | static int lirc_serial_resume(struct platform_device *dev) |
1127 | { | 1126 | { |
1128 | unsigned long flags; | 1127 | unsigned long flags; |
1128 | int result; | ||
1129 | 1129 | ||
1130 | if (hardware_init_port() < 0) | 1130 | result = hardware_init_port(); |
1131 | return -EINVAL; | 1131 | if (result < 0) |
1132 | return result; | ||
1132 | 1133 | ||
1133 | spin_lock_irqsave(&hardware[type].lock, flags); | 1134 | spin_lock_irqsave(&hardware[type].lock, flags); |
1134 | /* Enable Interrupt */ | 1135 | /* Enable Interrupt */ |
@@ -1161,7 +1162,7 @@ static int __init lirc_serial_init(void) | |||
1161 | /* Init read buffer. */ | 1162 | /* Init read buffer. */ |
1162 | result = lirc_buffer_init(&rbuf, sizeof(int), RBUF_LEN); | 1163 | result = lirc_buffer_init(&rbuf, sizeof(int), RBUF_LEN); |
1163 | if (result < 0) | 1164 | if (result < 0) |
1164 | return -ENOMEM; | 1165 | return result; |
1165 | 1166 | ||
1166 | result = platform_driver_register(&lirc_serial_driver); | 1167 | result = platform_driver_register(&lirc_serial_driver); |
1167 | if (result) { | 1168 | if (result) { |
@@ -1247,7 +1248,7 @@ static int __init lirc_serial_init_module(void) | |||
1247 | printk(KERN_ERR LIRC_DRIVER_NAME | 1248 | printk(KERN_ERR LIRC_DRIVER_NAME |
1248 | ": register_chrdev failed!\n"); | 1249 | ": register_chrdev failed!\n"); |
1249 | lirc_serial_exit(); | 1250 | lirc_serial_exit(); |
1250 | return -EIO; | 1251 | return driver.minor; |
1251 | } | 1252 | } |
1252 | return 0; | 1253 | return 0; |
1253 | } | 1254 | } |