summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2021-02-22 14:46:42 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-03-11 11:59:41 +0100
commit0ec694d6718a9fab0f49a280557feb257c9d7843 (patch)
treeaefa95f94497c1a4f16d47fbf53ea02a442f1321
parent28c7afb07ccfc0a939bb06ac1e7afe669901c65a (diff)
media: ite-cir: in_use is not needed
The in_use variable is set to true when a lirc file is opened, and ir transmit can only be done by writing to a lirc file descriptor. As a result when in_use is read, it is always true, so we might as well remove it. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/rc/ite-cir.c9
-rw-r--r--drivers/media/rc/ite-cir.h2
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 2e9a6ef86940..9388774df9d7 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -364,7 +364,7 @@ static int ite_tx_ir(struct rc_dev *rcdev, unsigned *txbuf, unsigned n)
* has been pushed out */
fifo_avail = ITE_TX_FIFO_LEN - dev->params->get_tx_used_slots(dev);
- while (n > 0 && dev->in_use) {
+ while (n > 0) {
/* transmit the next sample */
is_pulse = !is_pulse;
remaining_us = *(txbuf++);
@@ -374,7 +374,7 @@ static int ite_tx_ir(struct rc_dev *rcdev, unsigned *txbuf, unsigned n)
is_pulse ? "pulse" : "space", remaining_us);
/* repeat while the pulse is non-zero length */
- while (remaining_us > 0 && dev->in_use) {
+ while (remaining_us > 0) {
if (remaining_us > max_rle_us)
next_rle_us = max_rle_us;
@@ -461,8 +461,7 @@ static int ite_tx_ir(struct rc_dev *rcdev, unsigned *txbuf, unsigned n)
ite_set_carrier_params(dev);
/* re-enable the receiver */
- if (dev->in_use)
- dev->params->enable_rx(dev);
+ dev->params->enable_rx(dev);
/* notify transmission end */
wake_up_interruptible(&dev->tx_ended);
@@ -1177,7 +1176,6 @@ static int ite_open(struct rc_dev *rcdev)
unsigned long flags;
spin_lock_irqsave(&dev->lock, flags);
- dev->in_use = true;
/* enable the receiver */
dev->params->enable_rx(dev);
@@ -1194,7 +1192,6 @@ static void ite_close(struct rc_dev *rcdev)
unsigned long flags;
spin_lock_irqsave(&dev->lock, flags);
- dev->in_use = false;
/* wait for any transmission to end */
spin_unlock_irqrestore(&dev->lock, flags);
diff --git a/drivers/media/rc/ite-cir.h b/drivers/media/rc/ite-cir.h
index cb3dc4ca2b0a..ce7a40b10828 100644
--- a/drivers/media/rc/ite-cir.h
+++ b/drivers/media/rc/ite-cir.h
@@ -81,7 +81,7 @@ struct ite_dev {
/* sync data */
spinlock_t lock;
- bool in_use, transmitting;
+ bool transmitting;
/* transmit support */
wait_queue_head_t tx_queue, tx_ended;