Skip to content

Commit e40b3e3

Browse files
committed
drivers: sensor: fix PM Implementation for LM75 temperature sensor
fixes the driver always returning -EIO if PM_DEVICE_RUNTIME is enabled. Signed-off-by: Jonas Woerner <jonas.woerner@online.de>
1 parent 71b7101 commit e40b3e3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/sensor/lm75/lm75.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ static int lm75_sample_fetch(const struct device *dev,
6464
{
6565
struct lm75_data *data = dev->data;
6666
const struct lm75_config *cfg = dev->config;
67-
enum pm_device_state pm_state;
6867
int ret;
6968

70-
(void)pm_device_state_get(dev, &pm_state);
71-
if (pm_state != PM_DEVICE_STATE_ACTIVE) {
72-
ret = -EIO;
69+
ret = pm_device_runtime_get(dev);
70+
if (ret < 0) {
7371
return ret;
7472
}
7573

@@ -83,6 +81,7 @@ static int lm75_sample_fetch(const struct device *dev,
8381
break;
8482
}
8583

84+
pm_device_runtime_put(dev);
8685
return ret;
8786
}
8887

0 commit comments

Comments
 (0)