Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bq274xx sensor - Fails to compile when CONFIG_PM_DEVICE enabled #39721

Closed
ballardr opened this issue Oct 26, 2021 · 1 comment · Fixed by #39706
Closed

bq274xx sensor - Fails to compile when CONFIG_PM_DEVICE enabled #39721

ballardr opened this issue Oct 26, 2021 · 1 comment · Fixed by #39706
Assignees
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@ballardr
Copy link

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

@ballardr ballardr added the bug The issue is a bug, or the PR is fixing a bug label Oct 26, 2021
@gmarull
Copy link
Member

gmarull commented Oct 26, 2021

A fix is available here: #39706

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Sensors Sensors bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants