diff options
Diffstat (limited to 'drivers/media/rc/ene_ir.c')
| -rw-r--r-- | drivers/media/rc/ene_ir.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index d05ac15b5de4..cef04786b52f 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c | |||
| @@ -329,7 +329,7 @@ static int ene_rx_get_sample_reg(struct ene_device *dev) | |||
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | /* Sense current received carrier */ | 331 | /* Sense current received carrier */ |
| 332 | void ene_rx_sense_carrier(struct ene_device *dev) | 332 | static void ene_rx_sense_carrier(struct ene_device *dev) |
| 333 | { | 333 | { |
| 334 | DEFINE_IR_RAW_EVENT(ev); | 334 | DEFINE_IR_RAW_EVENT(ev); |
| 335 | 335 | ||
| @@ -1003,7 +1003,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1003 | dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL); | 1003 | dev = kzalloc(sizeof(struct ene_device), GFP_KERNEL); |
| 1004 | rdev = rc_allocate_device(); | 1004 | rdev = rc_allocate_device(); |
| 1005 | if (!dev || !rdev) | 1005 | if (!dev || !rdev) |
| 1006 | goto error1; | 1006 | goto failure; |
| 1007 | 1007 | ||
| 1008 | /* validate resources */ | 1008 | /* validate resources */ |
| 1009 | error = -ENODEV; | 1009 | error = -ENODEV; |
| @@ -1014,10 +1014,10 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1014 | 1014 | ||
| 1015 | if (!pnp_port_valid(pnp_dev, 0) || | 1015 | if (!pnp_port_valid(pnp_dev, 0) || |
| 1016 | pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) | 1016 | pnp_port_len(pnp_dev, 0) < ENE_IO_SIZE) |
| 1017 | goto error; | 1017 | goto failure; |
| 1018 | 1018 | ||
| 1019 | if (!pnp_irq_valid(pnp_dev, 0)) | 1019 | if (!pnp_irq_valid(pnp_dev, 0)) |
| 1020 | goto error; | 1020 | goto failure; |
| 1021 | 1021 | ||
| 1022 | spin_lock_init(&dev->hw_lock); | 1022 | spin_lock_init(&dev->hw_lock); |
| 1023 | 1023 | ||
| @@ -1033,7 +1033,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1033 | /* detect hardware version and features */ | 1033 | /* detect hardware version and features */ |
| 1034 | error = ene_hw_detect(dev); | 1034 | error = ene_hw_detect(dev); |
| 1035 | if (error) | 1035 | if (error) |
| 1036 | goto error; | 1036 | goto failure; |
| 1037 | 1037 | ||
| 1038 | if (!dev->hw_learning_and_tx_capable && txsim) { | 1038 | if (!dev->hw_learning_and_tx_capable && txsim) { |
| 1039 | dev->hw_learning_and_tx_capable = true; | 1039 | dev->hw_learning_and_tx_capable = true; |
| @@ -1046,7 +1046,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1046 | learning_mode_force = false; | 1046 | learning_mode_force = false; |
| 1047 | 1047 | ||
| 1048 | rdev->driver_type = RC_DRIVER_IR_RAW; | 1048 | rdev->driver_type = RC_DRIVER_IR_RAW; |
| 1049 | rdev->allowed_protos = RC_TYPE_ALL; | 1049 | rdev->allowed_protos = RC_BIT_ALL; |
| 1050 | rdev->priv = dev; | 1050 | rdev->priv = dev; |
| 1051 | rdev->open = ene_open; | 1051 | rdev->open = ene_open; |
| 1052 | rdev->close = ene_close; | 1052 | rdev->close = ene_close; |
| @@ -1078,30 +1078,27 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1078 | /* claim the resources */ | 1078 | /* claim the resources */ |
| 1079 | error = -EBUSY; | 1079 | error = -EBUSY; |
| 1080 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | 1080 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { |
| 1081 | dev->hw_io = -1; | 1081 | goto failure; |
| 1082 | dev->irq = -1; | ||
| 1083 | goto error; | ||
| 1084 | } | 1082 | } |
| 1085 | 1083 | ||
| 1086 | dev->irq = pnp_irq(pnp_dev, 0); | 1084 | dev->irq = pnp_irq(pnp_dev, 0); |
| 1087 | if (request_irq(dev->irq, ene_isr, | 1085 | if (request_irq(dev->irq, ene_isr, |
| 1088 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | 1086 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { |
| 1089 | dev->irq = -1; | 1087 | goto failure2; |
| 1090 | goto error; | ||
| 1091 | } | 1088 | } |
| 1092 | 1089 | ||
| 1093 | error = rc_register_device(rdev); | 1090 | error = rc_register_device(rdev); |
| 1094 | if (error < 0) | 1091 | if (error < 0) |
| 1095 | goto error; | 1092 | goto failure3; |
| 1096 | 1093 | ||
| 1097 | pr_notice("driver has been successfully loaded\n"); | 1094 | pr_notice("driver has been successfully loaded\n"); |
| 1098 | return 0; | 1095 | return 0; |
| 1099 | error: | 1096 | |
| 1100 | if (dev && dev->irq >= 0) | 1097 | failure3: |
| 1101 | free_irq(dev->irq, dev); | 1098 | free_irq(dev->irq, dev); |
| 1102 | if (dev && dev->hw_io >= 0) | 1099 | failure2: |
| 1103 | release_region(dev->hw_io, ENE_IO_SIZE); | 1100 | release_region(dev->hw_io, ENE_IO_SIZE); |
| 1104 | error1: | 1101 | failure: |
| 1105 | rc_free_device(rdev); | 1102 | rc_free_device(rdev); |
| 1106 | kfree(dev); | 1103 | kfree(dev); |
| 1107 | return error; | 1104 | return error; |
| @@ -1175,7 +1172,7 @@ static struct pnp_driver ene_driver = { | |||
| 1175 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, | 1172 | .flags = PNP_DRIVER_RES_DO_NOT_CHANGE, |
| 1176 | 1173 | ||
| 1177 | .probe = ene_probe, | 1174 | .probe = ene_probe, |
| 1178 | .remove = __devexit_p(ene_remove), | 1175 | .remove = ene_remove, |
| 1179 | #ifdef CONFIG_PM | 1176 | #ifdef CONFIG_PM |
| 1180 | .suspend = ene_suspend, | 1177 | .suspend = ene_suspend, |
| 1181 | .resume = ene_resume, | 1178 | .resume = ene_resume, |
