power: device_pm: Use spin lock instead of semaphore
Device pm runtime was using semaphore to protect critical section but enable / disable functions were waiting on the semaphore. So, just replace it with a spin lock. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
39ec8c1cb9
commit
54324fd08e
3 changed files with 11 additions and 6 deletions
|
@ -87,7 +87,7 @@ struct pm_device {
|
|||
/** Pointer to the device */
|
||||
const struct device *dev;
|
||||
/** Lock to synchronize the get/put operations */
|
||||
struct k_sem lock;
|
||||
struct k_spinlock lock;
|
||||
/* Following are packed fields protected by #lock. */
|
||||
/** Device pm enable flag */
|
||||
bool enable : 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue