diff options
Diffstat (limited to 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/ene_ir.c | 32 | ||||
-rw-r--r-- | drivers/media/rc/fintek-cir.c | 22 | ||||
-rw-r--r-- | drivers/media/rc/ite-cir.c | 20 | ||||
-rw-r--r-- | drivers/media/rc/nuvoton-cir.c | 36 | ||||
-rw-r--r-- | drivers/media/rc/winbond-cir.c | 78 |
5 files changed, 94 insertions, 94 deletions
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 860c112e0fd2..bef5296173c9 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c | |||
@@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
1018 | 1018 | ||
1019 | spin_lock_init(&dev->hw_lock); | 1019 | spin_lock_init(&dev->hw_lock); |
1020 | 1020 | ||
1021 | /* claim the resources */ | ||
1022 | error = -EBUSY; | ||
1023 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
1024 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
1025 | dev->hw_io = -1; | ||
1026 | dev->irq = -1; | ||
1027 | goto error; | ||
1028 | } | ||
1029 | |||
1030 | dev->irq = pnp_irq(pnp_dev, 0); | ||
1031 | if (request_irq(dev->irq, ene_isr, | ||
1032 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
1033 | dev->irq = -1; | ||
1034 | goto error; | ||
1035 | } | ||
1036 | |||
1037 | pnp_set_drvdata(pnp_dev, dev); | 1021 | pnp_set_drvdata(pnp_dev, dev); |
1038 | dev->pnp_dev = pnp_dev; | 1022 | dev->pnp_dev = pnp_dev; |
1039 | 1023 | ||
@@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
1086 | device_set_wakeup_capable(&pnp_dev->dev, true); | 1070 | device_set_wakeup_capable(&pnp_dev->dev, true); |
1087 | device_set_wakeup_enable(&pnp_dev->dev, true); | 1071 | device_set_wakeup_enable(&pnp_dev->dev, true); |
1088 | 1072 | ||
1073 | /* claim the resources */ | ||
1074 | error = -EBUSY; | ||
1075 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
1076 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
1077 | dev->hw_io = -1; | ||
1078 | dev->irq = -1; | ||
1079 | goto error; | ||
1080 | } | ||
1081 | |||
1082 | dev->irq = pnp_irq(pnp_dev, 0); | ||
1083 | if (request_irq(dev->irq, ene_isr, | ||
1084 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
1085 | dev->irq = -1; | ||
1086 | goto error; | ||
1087 | } | ||
1088 | |||
1089 | error = rc_register_device(rdev); | 1089 | error = rc_register_device(rdev); |
1090 | if (error < 0) | 1090 | if (error < 0) |
1091 | goto error; | 1091 | goto error; |
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 392d4be91f8f..4a3a238bcfbc 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c | |||
@@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) | |||
197 | /* | 197 | /* |
198 | * Newer reviews of this chipset uses port 8 instead of 5 | 198 | * Newer reviews of this chipset uses port 8 instead of 5 |
199 | */ | 199 | */ |
200 | if ((chip != 0x0408) || (chip != 0x0804)) | 200 | if ((chip != 0x0408) && (chip != 0x0804)) |
201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; | 201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; |
202 | else | 202 | else |
203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; | 203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; |
@@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
514 | 514 | ||
515 | spin_lock_init(&fintek->fintek_lock); | 515 | spin_lock_init(&fintek->fintek_lock); |
516 | 516 | ||
517 | ret = -EBUSY; | ||
518 | /* now claim resources */ | ||
519 | if (!request_region(fintek->cir_addr, | ||
520 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
521 | goto failure; | ||
522 | |||
523 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
524 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
525 | goto failure; | ||
526 | |||
527 | pnp_set_drvdata(pdev, fintek); | 517 | pnp_set_drvdata(pdev, fintek); |
528 | fintek->pdev = pdev; | 518 | fintek->pdev = pdev; |
529 | 519 | ||
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
558 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ | 548 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ |
559 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); | 549 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); |
560 | 550 | ||
551 | ret = -EBUSY; | ||
552 | /* now claim resources */ | ||
553 | if (!request_region(fintek->cir_addr, | ||
554 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
555 | goto failure; | ||
556 | |||
557 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
558 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
559 | goto failure; | ||
560 | |||
561 | ret = rc_register_device(rdev); | 561 | ret = rc_register_device(rdev); |
562 | if (ret) | 562 | if (ret) |
563 | goto failure; | 563 | goto failure; |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 682009d76cdf..0e49c99abf68 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1515 | /* initialize raw event */ | 1515 | /* initialize raw event */ |
1516 | init_ir_raw_event(&itdev->rawir); | 1516 | init_ir_raw_event(&itdev->rawir); |
1517 | 1517 | ||
1518 | ret = -EBUSY; | ||
1519 | /* now claim resources */ | ||
1520 | if (!request_region(itdev->cir_addr, | ||
1521 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1522 | goto failure; | ||
1523 | |||
1524 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1525 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1526 | goto failure; | ||
1527 | |||
1528 | /* set driver data into the pnp device */ | 1518 | /* set driver data into the pnp device */ |
1529 | pnp_set_drvdata(pdev, itdev); | 1519 | pnp_set_drvdata(pdev, itdev); |
1530 | itdev->pdev = pdev; | 1520 | itdev->pdev = pdev; |
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
1600 | rdev->driver_name = ITE_DRIVER_NAME; | 1590 | rdev->driver_name = ITE_DRIVER_NAME; |
1601 | rdev->map_name = RC_MAP_RC6_MCE; | 1591 | rdev->map_name = RC_MAP_RC6_MCE; |
1602 | 1592 | ||
1593 | ret = -EBUSY; | ||
1594 | /* now claim resources */ | ||
1595 | if (!request_region(itdev->cir_addr, | ||
1596 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
1597 | goto failure; | ||
1598 | |||
1599 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
1600 | ITE_DRIVER_NAME, (void *)itdev)) | ||
1601 | goto failure; | ||
1602 | |||
1603 | ret = rc_register_device(rdev); | 1603 | ret = rc_register_device(rdev); |
1604 | if (ret) | 1604 | if (ret) |
1605 | goto failure; | 1605 | goto failure; |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 144f3f55d765..8b2c071ac0ab 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
@@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1021 | spin_lock_init(&nvt->nvt_lock); | 1021 | spin_lock_init(&nvt->nvt_lock); |
1022 | spin_lock_init(&nvt->tx.lock); | 1022 | spin_lock_init(&nvt->tx.lock); |
1023 | 1023 | ||
1024 | ret = -EBUSY; | ||
1025 | /* now claim resources */ | ||
1026 | if (!request_region(nvt->cir_addr, | ||
1027 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1028 | goto failure; | ||
1029 | |||
1030 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
1031 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1032 | goto failure; | ||
1033 | |||
1034 | if (!request_region(nvt->cir_wake_addr, | ||
1035 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1036 | goto failure; | ||
1037 | |||
1038 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
1039 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1040 | goto failure; | ||
1041 | |||
1042 | pnp_set_drvdata(pdev, nvt); | 1024 | pnp_set_drvdata(pdev, nvt); |
1043 | nvt->pdev = pdev; | 1025 | nvt->pdev = pdev; |
1044 | 1026 | ||
@@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
1085 | rdev->tx_resolution = XYZ; | 1067 | rdev->tx_resolution = XYZ; |
1086 | #endif | 1068 | #endif |
1087 | 1069 | ||
1070 | ret = -EBUSY; | ||
1071 | /* now claim resources */ | ||
1072 | if (!request_region(nvt->cir_addr, | ||
1073 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1074 | goto failure; | ||
1075 | |||
1076 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
1077 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1078 | goto failure; | ||
1079 | |||
1080 | if (!request_region(nvt->cir_wake_addr, | ||
1081 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
1082 | goto failure; | ||
1083 | |||
1084 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
1085 | NVT_DRIVER_NAME, (void *)nvt)) | ||
1086 | goto failure; | ||
1087 | |||
1088 | ret = rc_register_device(rdev); | 1088 | ret = rc_register_device(rdev); |
1089 | if (ret) | 1089 | if (ret) |
1090 | goto failure; | 1090 | goto failure; |
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); |