Lines Matching refs:ret

18 	int ret;  in read_temperature()  local
20 ret = sensor_sample_fetch_chan(dev, SENSOR_CHAN_AMBIENT_TEMP); in read_temperature()
21 if (ret < 0) { in read_temperature()
22 printf("Could not fetch temperature: %d\n", ret); in read_temperature()
23 return ret; in read_temperature()
26 ret = sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, val); in read_temperature()
27 if (ret < 0) { in read_temperature()
28 printf("Could not get temperature: %d\n", ret); in read_temperature()
30 return ret; in read_temperature()
35 int ret; in temp_alert_handler() local
40 ret = read_temperature(dev, &value); in temp_alert_handler()
41 if (ret < 0) { in temp_alert_handler()
42 printf("Reading temperature failed: %d\n", ret); in temp_alert_handler()
60 int ret; in main() local
76 ret = read_temperature(dev, &value); in main()
77 if (ret != 0) { in main()
78 printf("Failed to read temperature: %d\n", ret); in main()
79 return ret; in main()
85 ret = sensor_value_from_double(&value, low_temp); in main()
86 if (ret != 0) { in main()
87 printf("Failed to convert low threshold to sensor value: %d\n", ret); in main()
88 return ret; in main()
90 ret = sensor_attr_set(dev, SENSOR_CHAN_AMBIENT_TEMP, in main()
92 if (ret == 0) { in main()
98 ret = sensor_value_from_double(&value, high_temp); in main()
99 if (ret != 0) { in main()
100 printf("Failed to convert low threshold to sensor value: %d\n", ret); in main()
101 return ret; in main()
103 ret = sensor_attr_set(dev, SENSOR_CHAN_AMBIENT_TEMP, in main()
105 if (ret == 0) { in main()
110 ret = sensor_trigger_set(dev, &trig, temp_alert_handler); in main()
111 if (ret == 0) { in main()
116 ret = read_temperature(dev, &value); in main()
117 if (ret != 0) { in main()
118 printf("Failed to read temperature: %d\n", ret); in main()