aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/rc/winbond-cir.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/rc/winbond-cir.c')
-rw-r--r--drivers/media/rc/winbond-cir.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index 7f3c476dde05..553d1cdc439f 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -1093,11 +1093,15 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1093 data->dev->rx_resolution = US_TO_NS(2); 1093 data->dev->rx_resolution = US_TO_NS(2);
1094 data->dev->allowed_protos = RC_BIT_ALL; 1094 data->dev->allowed_protos = RC_BIT_ALL;
1095 1095
1096 err = rc_register_device(data->dev);
1097 if (err)
1098 goto exit_free_rc;
1099
1096 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { 1100 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
1097 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", 1101 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1098 data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); 1102 data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
1099 err = -EBUSY; 1103 err = -EBUSY;
1100 goto exit_free_rc; 1104 goto exit_unregister_device;
1101 } 1105 }
1102 1106
1103 if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { 1107 if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
@@ -1122,24 +1126,20 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1122 goto exit_release_sbase; 1126 goto exit_release_sbase;
1123 } 1127 }
1124 1128
1125 err = rc_register_device(data->dev);
1126 if (err)
1127 goto exit_free_irq;
1128
1129 device_init_wakeup(&device->dev, 1); 1129 device_init_wakeup(&device->dev, 1);
1130 1130
1131 wbcir_init_hw(data); 1131 wbcir_init_hw(data);
1132 1132
1133 return 0; 1133 return 0;
1134 1134
1135exit_free_irq:
1136 free_irq(data->irq, device);
1137exit_release_sbase: 1135exit_release_sbase:
1138 release_region(data->sbase, SP_IOMEM_LEN); 1136 release_region(data->sbase, SP_IOMEM_LEN);
1139exit_release_ebase: 1137exit_release_ebase:
1140 release_region(data->ebase, EHFUNC_IOMEM_LEN); 1138 release_region(data->ebase, EHFUNC_IOMEM_LEN);
1141exit_release_wbase: 1139exit_release_wbase:
1142 release_region(data->wbase, WAKEUP_IOMEM_LEN); 1140 release_region(data->wbase, WAKEUP_IOMEM_LEN);
1141exit_unregister_device:
1142 rc_unregister_device(data->dev);
1143exit_free_rc: 1143exit_free_rc:
1144 rc_free_device(data->dev); 1144 rc_free_device(data->dev);
1145exit_unregister_led: 1145exit_unregister_led: