diff options
Diffstat (limited to 'drivers/media/rc/winbond-cir.c')
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index af526586fa26..342c2c8c1ddf 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
@@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", | 991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", |
992 | data->wbase, data->ebase, data->sbase, data->irq); | 992 | data->wbase, data->ebase, data->sbase, data->irq); |
993 | 993 | ||
994 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
995 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
996 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
997 | err = -EBUSY; | ||
998 | goto exit_free_data; | ||
999 | } | ||
1000 | |||
1001 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
1002 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1003 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
1004 | err = -EBUSY; | ||
1005 | goto exit_release_wbase; | ||
1006 | } | ||
1007 | |||
1008 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
1009 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1010 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
1011 | err = -EBUSY; | ||
1012 | goto exit_release_ebase; | ||
1013 | } | ||
1014 | |||
1015 | err = request_irq(data->irq, wbcir_irq_handler, | ||
1016 | IRQF_DISABLED, DRVNAME, device); | ||
1017 | if (err) { | ||
1018 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
1019 | err = -EBUSY; | ||
1020 | goto exit_release_sbase; | ||
1021 | } | ||
1022 | |||
1023 | led_trigger_register_simple("cir-tx", &data->txtrigger); | 994 | led_trigger_register_simple("cir-tx", &data->txtrigger); |
1024 | if (!data->txtrigger) { | 995 | if (!data->txtrigger) { |
1025 | err = -ENOMEM; | 996 | err = -ENOMEM; |
1026 | goto exit_free_irq; | 997 | goto exit_free_data; |
1027 | } | 998 | } |
1028 | 999 | ||
1029 | led_trigger_register_simple("cir-rx", &data->rxtrigger); | 1000 | led_trigger_register_simple("cir-rx", &data->rxtrigger); |
@@ -1062,9 +1033,38 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1062 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
1063 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
1064 | 1035 | ||
1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1038 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
1039 | err = -EBUSY; | ||
1040 | goto exit_free_rc; | ||
1041 | } | ||
1042 | |||
1043 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
1044 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1045 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
1046 | err = -EBUSY; | ||
1047 | goto exit_release_wbase; | ||
1048 | } | ||
1049 | |||
1050 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
1051 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
1052 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
1053 | err = -EBUSY; | ||
1054 | goto exit_release_ebase; | ||
1055 | } | ||
1056 | |||
1057 | err = request_irq(data->irq, wbcir_irq_handler, | ||
1058 | IRQF_DISABLED, DRVNAME, device); | ||
1059 | if (err) { | ||
1060 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
1061 | err = -EBUSY; | ||
1062 | goto exit_release_sbase; | ||
1063 | } | ||
1064 | |||
1065 | err = rc_register_device(data->dev); | 1065 | err = rc_register_device(data->dev); |
1066 | if (err) | 1066 | if (err) |
1067 | goto exit_free_rc; | 1067 | goto exit_free_irq; |
1068 | 1068 | ||
1069 | device_init_wakeup(&device->dev, 1); | 1069 | device_init_wakeup(&device->dev, 1); |
1070 | 1070 | ||
@@ -1072,14 +1072,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
1072 | 1072 | ||
1073 | return 0; | 1073 | return 0; |
1074 | 1074 | ||
1075 | exit_free_rc: | ||
1076 | rc_free_device(data->dev); | ||
1077 | exit_unregister_led: | ||
1078 | led_classdev_unregister(&data->led); | ||
1079 | exit_unregister_rxtrigger: | ||
1080 | led_trigger_unregister_simple(data->rxtrigger); | ||
1081 | exit_unregister_txtrigger: | ||
1082 | led_trigger_unregister_simple(data->txtrigger); | ||
1083 | exit_free_irq: | 1075 | exit_free_irq: |
1084 | free_irq(data->irq, device); | 1076 | free_irq(data->irq, device); |
1085 | exit_release_sbase: | 1077 | exit_release_sbase: |
@@ -1088,6 +1080,14 @@ exit_release_ebase: | |||
1088 | release_region(data->ebase, EHFUNC_IOMEM_LEN); | 1080 | release_region(data->ebase, EHFUNC_IOMEM_LEN); |
1089 | exit_release_wbase: | 1081 | exit_release_wbase: |
1090 | release_region(data->wbase, WAKEUP_IOMEM_LEN); | 1082 | release_region(data->wbase, WAKEUP_IOMEM_LEN); |
1083 | exit_free_rc: | ||
1084 | rc_free_device(data->dev); | ||
1085 | exit_unregister_led: | ||
1086 | led_classdev_unregister(&data->led); | ||
1087 | exit_unregister_rxtrigger: | ||
1088 | led_trigger_unregister_simple(data->rxtrigger); | ||
1089 | exit_unregister_txtrigger: | ||
1090 | led_trigger_unregister_simple(data->txtrigger); | ||
1091 | exit_free_data: | 1091 | exit_free_data: |
1092 | kfree(data); | 1092 | kfree(data); |
1093 | pnp_set_drvdata(device, NULL); | 1093 | pnp_set_drvdata(device, NULL); |