drivers: fix pm callback signature
For some reason a few drivers were not converted to the new device PM callback signature. The reason may be because the device PM part is compiled only when CONFIG_PM_DEVICE=y, a condition not enabled in CI by default. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
6ce18c6e6a
commit
45a6de6804
8 changed files with 27 additions and 26 deletions
|
@ -391,7 +391,7 @@ static int bme280_chip_init(const struct device *dev)
|
|||
|
||||
#ifdef CONFIG_PM_DEVICE
|
||||
int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
|
||||
void *context, pm_device_cb cb, void *arg)
|
||||
uint32_t *state, pm_device_cb cb, void *arg)
|
||||
{
|
||||
struct bme280_data *data = to_data(dev);
|
||||
|
||||
|
@ -399,7 +399,7 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
|
|||
|
||||
/* Set power state */
|
||||
if (ctrl_command == PM_DEVICE_STATE_SET) {
|
||||
uint32_t new_pm_state = *((const uint32_t *)context);
|
||||
uint32_t new_pm_state = *state;
|
||||
|
||||
if (new_pm_state != data->pm_state) {
|
||||
|
||||
|
@ -430,12 +430,12 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
|
|||
/* Get power state */
|
||||
else {
|
||||
__ASSERT_NO_MSG(ctrl_command == PM_DEVICE_STATE_GET);
|
||||
*((uint32_t *)context) = data->pm_state;
|
||||
*state = data->pm_state;
|
||||
}
|
||||
|
||||
/* Invoke callback if any */
|
||||
if (cb)
|
||||
cb(dev, ret, context, arg);
|
||||
cb(dev, ret, state, arg);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue