bq274xx sensor - Fails to compile when CONFIG_PM_DEVICE enabled #39721
Labels
area: Sensors
Sensors
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
When using the bq274xx sensor (kconfigs: CONFIG_SENSOR=y; CONFIG_BQ274XX=y), in conjunction with kconfig CONFIG_PM_DEVICE, the bq274xx sensor module fails to compile as on line 652 of zephyr/drivers/sensor/bq274xx/bq274xx.c, it tries to access the struct member "pm_state" of bq274xx which is of type "struct bq274xx_data" (as per line 414). However in zephyr/drivers/sensor/bq274xx/bq274xx.h it can be seen this structure has no pm_state member.
** ***** NOTE: I submitted this earlier (#39712), but it got closed with a fix that is completely unrelated and does not fix the the structure as per the logs and console section below. gmarull, please read the bug before closing immaturely ***** **
To Reproduce
Enable the following kconfigs:
CONFIG_SENSOR=y
CONFIG_BQ274XX=y
CONFIG_PM=y
CONFIG_PM_DEVICE=y
Expected behavior
The code in question is designed to make sure the sensor is powered
Impact
Fails to compile
Logs and console output
F:/zephyrproject/zephyr/drivers/sensor/bq274xx/bq274xx.c: In function 'bq274xx_gauge_configure':
F:/zephyrproject/zephyr/drivers/sensor/bq274xx/bq274xx.c:652:9: error: 'struct bq274xx_data' has no member named 'pm_state'
652 | bq274xx->pm_state = PM_DEVICE_STATE_ACTIVE;
Environment (please complete the following information):
Windows
Zephyr 2.7.99 (latest git pull as of Tue, 26 Oct 2021 02:20:04 GMT)
** Work around **
For the time being, I'm commenting out lines 651 to 653 of zephyr/drivers/sensor/bq274xx/bq274xx.c
The text was updated successfully, but these errors were encountered: