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 4ef1163 commit b71e819Copy full SHA for b71e819
drivers/fuel_gauge/composite/fuel_gauge_composite.c
@@ -28,17 +28,19 @@ struct composite_data {
28
29
static int composite_fetch(const struct device *dev)
30
{
31
- int rc;
+ int rc, rc2;
32
33
rc = pm_device_runtime_get(dev);
34
if (rc < 0) {
35
return rc;
36
}
37
rc = sensor_sample_fetch(dev);
38
- if (rc < 0) {
39
- return rc;
+ /* Uncondionally release the PM constraint */
+ rc2 = pm_device_runtime_put(dev);
40
+ if (rc == 0) {
41
+ rc = rc2;
42
- return pm_device_runtime_put(dev);
43
+ return rc;
44
45
46
static int composite_channel_get(const struct device *dev, enum sensor_channel chan,
0 commit comments