Skip to content

Commit 9c55e2b

Browse files
Flavio Ceolinnashif
authored andcommitted
drivers: bme280: Replace deprecated Kconfig option
Use CONFIG_PM_DEVICE instead of using CONFIG_DEVICE_POWER_MANAGEMENT. Fixes: #31920 Signed-off-by: Flavio Ceolin <[email protected]>
1 parent b7acb6b commit 9c55e2b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/sensor/bme280/bme280.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct bme280_data {
7777

7878
uint8_t chip_id;
7979

80-
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
80+
#ifdef CONFIG_PM_DEVICE
8181
uint32_t pm_state; /* Current power state */
8282
#endif
8383
};
@@ -322,7 +322,7 @@ static int bme280_sample_fetch(const struct device *dev,
322322

323323
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL);
324324

325-
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
325+
#ifdef CONFIG_PM_DEVICE
326326
/* Do not allow sample fetching from OFF state */
327327
if (data->pm_state == DEVICE_PM_OFF_STATE)
328328
return -EIO;
@@ -585,7 +585,7 @@ int bme280_init(const struct device *dev)
585585

586586
rc = 0;
587587

588-
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
588+
#ifdef CONFIG_PM_DEVICE
589589
/* Set power state to ACTIVE */
590590
data->pm_state = DEVICE_PM_ACTIVE_STATE;
591591
#endif
@@ -599,7 +599,7 @@ int bme280_init(const struct device *dev)
599599
return rc;
600600
}
601601

602-
#ifdef CONFIG_DEVICE_POWER_MANAGEMENT
602+
#ifdef CONFIG_PM_DEVICE
603603
int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
604604
void *context, device_pm_cb cb, void *arg)
605605
{
@@ -649,7 +649,7 @@ int bme280_pm_ctrl(const struct device *dev, uint32_t ctrl_command,
649649

650650
return ret;
651651
}
652-
#endif /* CONFIG_DEVICE_POWER_MANAGEMENT */
652+
#endif /* CONFIG_PM_DEVICE */
653653

654654

655655
/*

0 commit comments

Comments
 (0)