drivers: bme280: fix: build broken after PM changes

The driver did not build with PM_DEVICE enabled.
commit to blame: cc2f0e9c08

Signed-off-by: Efrain Calderon <efrain.calderon@aquarobur.com>
This commit is contained in:
Efrain Calderon 2021-07-27 19:45:46 +02:00 committed by Christopher Friedt
commit 86e656b640

View file

@ -408,7 +408,7 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
ret = bme280_chip_init(dev);
}
/* Switching to OFF from any */
else if (new_pm_state == PM_DEVICE_STATE_OFF) {
else if (*state == PM_DEVICE_STATE_OFF) {
/* Put the chip into sleep mode */
ret = bme280_reg_write(dev,
@ -422,7 +422,7 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
/* Store the new state */
if (!ret)
data->pm_state = new_pm_state;
data->pm_state = *state;
}
}
/* Get power state */