Browse Source

pm: policy: remove redundant ifdef exclusion of device_power_lock

Remove redundant ifdef exclusion of calls to
pm_policy_device_power_lock_get() and
pm_policy_device_power_lock_put().

Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
pull/91106/head
Bjarki Arge Andreasen 1 month ago committed by Benjamin Cabé
parent
commit
a8d44c37c4
  1. 4
      drivers/i2c/i2c_mcux_flexcomm.c
  2. 10
      drivers/mipi_dbi/mipi_dbi_nxp_lcdic.c

4
drivers/i2c/i2c_mcux_flexcomm.c

@ -157,9 +157,7 @@ static int mcux_flexcomm_transfer(const struct device *dev,
k_sem_take(&data->lock, K_FOREVER); k_sem_take(&data->lock, K_FOREVER);
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_get(dev); pm_policy_device_power_lock_get(dev);
#endif
/* Iterate over all the messages */ /* Iterate over all the messages */
for (int i = 0; i < num_msgs; i++) { for (int i = 0; i < num_msgs; i++) {
@ -215,9 +213,7 @@ static int mcux_flexcomm_transfer(const struct device *dev,
msgs++; msgs++;
} }
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_put(dev); pm_policy_device_power_lock_put(dev);
#endif
k_sem_give(&data->lock); k_sem_give(&data->lock);

10
drivers/mipi_dbi/mipi_dbi_nxp_lcdic.c

@ -430,9 +430,7 @@ static int mipi_dbi_lcdic_write_display(const struct device *dev,
goto release_sem; goto release_sem;
} }
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_get(dev); pm_policy_device_power_lock_get(dev);
#endif
ret = mipi_dbi_lcdic_configure(dev, dbi_config); ret = mipi_dbi_lcdic_configure(dev, dbi_config);
if (ret) { if (ret) {
@ -527,9 +525,7 @@ static int mipi_dbi_lcdic_write_display(const struct device *dev,
} }
release_power_lock: release_power_lock:
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_put(dev); pm_policy_device_power_lock_put(dev);
#endif
release_sem: release_sem:
k_sem_give(&dev_data->lock); k_sem_give(&dev_data->lock);
@ -554,9 +550,7 @@ static int mipi_dbi_lcdic_write_cmd(const struct device *dev,
goto release_sem; goto release_sem;
} }
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_get(dev); pm_policy_device_power_lock_get(dev);
#endif
ret = mipi_dbi_lcdic_configure(dev, dbi_config); ret = mipi_dbi_lcdic_configure(dev, dbi_config);
if (ret) { if (ret) {
@ -632,9 +626,7 @@ static int mipi_dbi_lcdic_write_cmd(const struct device *dev,
} }
release_power_lock: release_power_lock:
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_put(dev); pm_policy_device_power_lock_put(dev);
#endif
release_sem: release_sem:
k_sem_give(&dev_data->lock); k_sem_give(&dev_data->lock);
@ -821,9 +813,7 @@ static void mipi_dbi_lcdic_isr(const struct device *dev)
base->IMR |= LCDIC_ALL_INTERRUPTS; base->IMR |= LCDIC_ALL_INTERRUPTS;
/* All data has been sent. */ /* All data has been sent. */
k_sem_give(&data->xfer_sem); k_sem_give(&data->xfer_sem);
#ifdef CONFIG_PM_POLICY_DEVICE_CONSTRAINTS
pm_policy_device_power_lock_put(dev); pm_policy_device_power_lock_put(dev);
#endif
} else { } else {
/* Command done. Queue next command */ /* Command done. Queue next command */
data->cmd_bytes = MIN(data->xfer_bytes, LCDIC_MAX_XFER); data->cmd_bytes = MIN(data->xfer_bytes, LCDIC_MAX_XFER);

Loading…
Cancel
Save