Commit fb2b0065 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Mauro Carvalho Chehab

[media] media: rc: nuvoton-cir: add locking to calls of nvt_enable_wake

Add locking to nvt_enable_wake calls.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 3f1321cb
...@@ -1174,16 +1174,16 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state) ...@@ -1174,16 +1174,16 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state)
nvt_dbg("%s called", __func__); nvt_dbg("%s called", __func__);
/* zero out misc state tracking */
spin_lock_irqsave(&nvt->nvt_lock, flags);
nvt->study_state = ST_STUDY_NONE;
nvt->wake_state = ST_WAKE_NONE;
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
spin_lock_irqsave(&nvt->tx.lock, flags); spin_lock_irqsave(&nvt->tx.lock, flags);
nvt->tx.tx_state = ST_TX_NONE; nvt->tx.tx_state = ST_TX_NONE;
spin_unlock_irqrestore(&nvt->tx.lock, flags); spin_unlock_irqrestore(&nvt->tx.lock, flags);
spin_lock_irqsave(&nvt->nvt_lock, flags);
/* zero out misc state tracking */
nvt->study_state = ST_STUDY_NONE;
nvt->wake_state = ST_WAKE_NONE;
/* disable all CIR interrupts */ /* disable all CIR interrupts */
nvt_cir_reg_write(nvt, 0, CIR_IREN); nvt_cir_reg_write(nvt, 0, CIR_IREN);
...@@ -1193,6 +1193,8 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state) ...@@ -1193,6 +1193,8 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state)
/* make sure wake is enabled */ /* make sure wake is enabled */
nvt_enable_wake(nvt); nvt_enable_wake(nvt);
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
return 0; return 0;
} }
...@@ -1211,7 +1213,11 @@ static int nvt_resume(struct pnp_dev *pdev) ...@@ -1211,7 +1213,11 @@ static int nvt_resume(struct pnp_dev *pdev)
static void nvt_shutdown(struct pnp_dev *pdev) static void nvt_shutdown(struct pnp_dev *pdev)
{ {
struct nvt_dev *nvt = pnp_get_drvdata(pdev); struct nvt_dev *nvt = pnp_get_drvdata(pdev);
unsigned long flags;
spin_lock_irqsave(&nvt->nvt_lock, flags);
nvt_enable_wake(nvt); nvt_enable_wake(nvt);
spin_unlock_irqrestore(&nvt->nvt_lock, flags);
} }
static const struct pnp_device_id nvt_ids[] = { static const struct pnp_device_id nvt_ids[] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment