We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71b7101 commit e40b3e3Copy full SHA for e40b3e3
drivers/sensor/lm75/lm75.c
@@ -64,12 +64,10 @@ static int lm75_sample_fetch(const struct device *dev,
64
{
65
struct lm75_data *data = dev->data;
66
const struct lm75_config *cfg = dev->config;
67
- enum pm_device_state pm_state;
68
int ret;
69
70
- (void)pm_device_state_get(dev, &pm_state);
71
- if (pm_state != PM_DEVICE_STATE_ACTIVE) {
72
- ret = -EIO;
+ ret = pm_device_runtime_get(dev);
+ if (ret < 0) {
73
return ret;
74
}
75
@@ -83,6 +81,7 @@ static int lm75_sample_fetch(const struct device *dev,
83
81
break;
84
82
85
+ pm_device_runtime_put(dev);
86
87
88
0 commit comments