@ -194,9 +194,7 @@ static int i2c_stm32_transfer(const struct device *dev, struct i2c_msg *msg,
k_sem_take ( & data - > bus_mutex , K_FOREVER ) ;
k_sem_take ( & data - > bus_mutex , K_FOREVER ) ;
/* Prevent driver from being suspended by PM until I2C transaction is complete */
/* Prevent driver from being suspended by PM until I2C transaction is complete */
# ifdef CONFIG_PM_DEVICE_RUNTIME
( void ) pm_device_runtime_get ( dev ) ;
( void ) pm_device_runtime_get ( dev ) ;
# endif
/* Prevent the clocks to be stopped during the i2c transaction */
/* Prevent the clocks to be stopped during the i2c transaction */
pm_policy_state_lock_get ( PM_STATE_SUSPEND_TO_IDLE , PM_ALL_SUBSTATES ) ;
pm_policy_state_lock_get ( PM_STATE_SUSPEND_TO_IDLE , PM_ALL_SUBSTATES ) ;
@ -220,9 +218,7 @@ static int i2c_stm32_transfer(const struct device *dev, struct i2c_msg *msg,
pm_policy_state_lock_put ( PM_STATE_SUSPEND_TO_IDLE , PM_ALL_SUBSTATES ) ;
pm_policy_state_lock_put ( PM_STATE_SUSPEND_TO_IDLE , PM_ALL_SUBSTATES ) ;
# ifdef CONFIG_PM_DEVICE_RUNTIME
( void ) pm_device_runtime_put ( dev ) ;
( void ) pm_device_runtime_put ( dev ) ;
# endif
k_sem_give ( & data - > bus_mutex ) ;
k_sem_give ( & data - > bus_mutex ) ;
@ -388,9 +384,7 @@ static int i2c_stm32_init(const struct device *dev)
return ret ;
return ret ;
}
}
# ifdef CONFIG_PM_DEVICE_RUNTIME
( void ) pm_device_runtime_enable ( dev ) ;
( void ) pm_device_runtime_enable ( dev ) ;
# endif
data - > is_configured = true ;
data - > is_configured = true ;