diff options
Diffstat (limited to 'drivers/media/rc/nuvoton-cir.c')
-rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 8b2c071ac0ab..dc8a7dddccd4 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -1075,19 +1075,19 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1075 | 1075 | ||
1076 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | 1076 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, |
1077 | NVT_DRIVER_NAME, (void *)nvt)) | 1077 | NVT_DRIVER_NAME, (void *)nvt)) |
1078 | goto failure; | 1078 | goto failure2; |
1079 | 1079 | ||
1080 | if (!request_region(nvt->cir_wake_addr, | 1080 | if (!request_region(nvt->cir_wake_addr, |
1081 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | 1081 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) |
1082 | goto failure; | 1082 | goto failure3; |
1083 | 1083 | ||
1084 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | 1084 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, |
1085 | NVT_DRIVER_NAME, (void *)nvt)) | 1085 | NVT_DRIVER_NAME, (void *)nvt)) |
1086 | goto failure; | 1086 | goto failure4; |
1087 | 1087 | ||
1088 | ret = rc_register_device(rdev); | 1088 | ret = rc_register_device(rdev); |
1089 | if (ret) | 1089 | if (ret) |
1090 | goto failure; | 1090 | goto failure5; |
1091 | 1091 | ||
1092 | device_init_wakeup(&pdev->dev, true); | 1092 | device_init_wakeup(&pdev->dev, true); |
1093 | nvt->rdev = rdev; | 1093 | nvt->rdev = rdev; |
@@ -1099,17 +1099,15 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1099 | 1099 | ||
1100 | return 0; | 1100 | return 0; |
1101 | 1101 | ||
1102 | failure5: | ||
1103 | free_irq(nvt->cir_wake_irq, nvt); | ||
1104 | failure4: | ||
1105 | release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH); | ||
1106 | failure3: | ||
1107 | free_irq(nvt->cir_irq, nvt); | ||
1108 | failure2: | ||
1109 | release_region(nvt->cir_addr, CIR_IOREG_LENGTH); | ||
1102 | failure: | 1110 | failure: |
1103 | if (nvt->cir_irq) | ||
1104 | free_irq(nvt->cir_irq, nvt); | ||
1105 | if (nvt->cir_addr) | ||
1106 | release_region(nvt->cir_addr, CIR_IOREG_LENGTH); | ||
1107 | |||
1108 | if (nvt->cir_wake_irq) | ||
1109 | free_irq(nvt->cir_wake_irq, nvt); | ||
1110 | if (nvt->cir_wake_addr) | ||
1111 | release_region(nvt->cir_wake_addr, CIR_IOREG_LENGTH); | ||
1112 | |||
1113 | rc_free_device(rdev); | 1111 | rc_free_device(rdev); |
1114 | kfree(nvt); | 1112 | kfree(nvt); |
1115 | 1113 | ||