Skip to content

Commit

Permalink
[media] media: rc: nuvoton: rename spinlock nvt_lock
Browse files Browse the repository at this point in the history
Spinlock nvt_lock is a member of struct nvt_dev and there's no need
to prefix it with nvt_. So remove this prefix.

[[email protected]: change the prefix also at the open function,
 as the patch removing it were not applied (yet?)]
Signed-off-by: Heiner Kallweit <[email protected]>

Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
hkallweit authored and mchehab committed Nov 18, 2016
1 parent f7ceec4 commit 73d4576
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions drivers/media/rc/nuvoton-cir.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static ssize_t wakeup_data_show(struct device *dev,
ssize_t buf_len = 0;
int i;

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

fifo_len = nvt_cir_wake_reg_read(nvt, CIR_WAKE_FIFO_COUNT);
fifo_len = min(fifo_len, WAKEUP_MAX_SIZE);
Expand All @@ -204,7 +204,7 @@ static ssize_t wakeup_data_show(struct device *dev,
}
buf_len += snprintf(buf + buf_len, PAGE_SIZE - buf_len, "\n");

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

return buf_len;
}
Expand Down Expand Up @@ -248,7 +248,7 @@ static ssize_t wakeup_data_store(struct device *dev,
/* hardcode the tolerance to 10% */
tolerance = DIV_ROUND_UP(count, 10);

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

nvt_clear_cir_wake_fifo(nvt);
nvt_cir_wake_reg_write(nvt, count, CIR_WAKE_FIFO_CMP_DEEP);
Expand All @@ -265,7 +265,7 @@ static ssize_t wakeup_data_store(struct device *dev,

nvt_cir_wake_reg_write(nvt, config, CIR_WAKE_IRCON);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

ret = len;
out:
Expand Down Expand Up @@ -590,7 +590,7 @@ static void nvt_enable_wake(struct nvt_dev *nvt)

nvt_efm_disable(nvt);

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

nvt_cir_wake_reg_write(nvt, CIR_WAKE_IRCON_MODE0 | CIR_WAKE_IRCON_RXEN |
CIR_WAKE_IRCON_R | CIR_WAKE_IRCON_RXINV |
Expand All @@ -599,11 +599,11 @@ static void nvt_enable_wake(struct nvt_dev *nvt)
nvt_cir_wake_reg_write(nvt, 0xff, CIR_WAKE_IRSTS);
nvt_cir_wake_reg_write(nvt, 0, CIR_WAKE_IREN);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);
}

#if 0 /* Currently unused */
/* rx carrier detect only works in learning mode, must be called w/nvt_lock */
/* rx carrier detect only works in learning mode, must be called w/lock */
static u32 nvt_rx_carrier_detect(struct nvt_dev *nvt)
{
u32 count, carrier, duration = 0;
Expand Down Expand Up @@ -688,7 +688,7 @@ static int nvt_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned n)
u8 iren;
int ret;

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

ret = min((unsigned)(TX_BUF_LEN / sizeof(unsigned)), n);
nvt->tx.buf_count = (ret * sizeof(unsigned));
Expand All @@ -712,13 +712,13 @@ static int nvt_tx_ir(struct rc_dev *dev, unsigned *txbuf, unsigned n)
for (i = 0; i < 9; i++)
nvt_cir_reg_write(nvt, 0x01, CIR_STXFIFO);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

wait_event(nvt->tx.queue, nvt->tx.tx_state == ST_TX_REQUEST);

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);
nvt->tx.tx_state = ST_TX_NONE;
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

/* restore enabled interrupts to prior state */
nvt_cir_reg_write(nvt, iren, CIR_IREN);
Expand Down Expand Up @@ -844,7 +844,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)

nvt_dbg_verbose("%s firing", __func__);

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

/*
* Get IR Status register contents. Write 1 to ack/clear
Expand All @@ -866,7 +866,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)
* logical device is being disabled.
*/
if (status == 0xff && iren == 0xff) {
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);
nvt_dbg_verbose("Spurious interrupt detected");
return IRQ_HANDLED;
}
Expand All @@ -875,7 +875,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)
* status bit whether the related interrupt source is enabled
*/
if (!(status & iren)) {
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);
nvt_dbg_verbose("%s exiting, IRSTS 0x0", __func__);
return IRQ_NONE;
}
Expand Down Expand Up @@ -923,7 +923,7 @@ static irqreturn_t nvt_cir_isr(int irq, void *data)
}
}

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

nvt_dbg_verbose("%s done", __func__);
return IRQ_HANDLED;
Expand All @@ -933,7 +933,7 @@ static void nvt_disable_cir(struct nvt_dev *nvt)
{
unsigned long flags;

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

/* disable CIR interrupts */
nvt_cir_reg_write(nvt, 0, CIR_IREN);
Expand All @@ -948,7 +948,7 @@ static void nvt_disable_cir(struct nvt_dev *nvt)
nvt_clear_cir_fifo(nvt);
nvt_clear_tx_fifo(nvt);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

/* disable the CIR logical device */
nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR);
Expand All @@ -959,7 +959,7 @@ static int nvt_open(struct rc_dev *dev)
struct nvt_dev *nvt = dev->priv;
unsigned long flags;

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

/* set function enable flags */
nvt_cir_reg_write(nvt, CIR_IRCON_TXEN | CIR_IRCON_RXEN |
Expand All @@ -972,7 +972,7 @@ static int nvt_open(struct rc_dev *dev)
/* enable interrupts */
nvt_set_cir_iren(nvt);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

/* enable the CIR logical device */
nvt_enable_logical_dev(nvt, LOGICAL_DEV_CIR);
Expand Down Expand Up @@ -1037,7 +1037,7 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
nvt->cr_efir = CR_EFIR;
nvt->cr_efdr = CR_EFDR;

spin_lock_init(&nvt->nvt_lock);
spin_lock_init(&nvt->lock);

pnp_set_drvdata(pdev, nvt);

Expand Down Expand Up @@ -1137,14 +1137,14 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state)

nvt_dbg("%s called", __func__);

spin_lock_irqsave(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->lock, flags);

nvt->tx.tx_state = ST_TX_NONE;

/* disable all CIR interrupts */
nvt_cir_reg_write(nvt, 0, CIR_IREN);

spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_unlock_irqrestore(&nvt->lock, flags);

/* disable cir logical dev */
nvt_disable_logical_dev(nvt, LOGICAL_DEV_CIR);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/rc/nuvoton-cir.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct nvt_chip {
struct nvt_dev {
struct rc_dev *rdev;

spinlock_t nvt_lock;
spinlock_t lock;

/* for rx */
u8 buf[RX_BUF_LEN];
Expand Down

0 comments on commit 73d4576

Please sign in to comment.