Lines Matching defs:sens
46 struct wf_sensor sens;
49 #define wf_to_sat(c) container_of(c, struct wf_sat_sensor, sens)
137 struct wf_sat_sensor *sens = wf_to_sat(sr);
138 struct wf_sat *sat = sens->sat;
152 i = sens->index * 2;
153 val = ((sat->cache[i] << 8) + sat->cache[i+1]) << sens->shift;
154 if (sens->index2 >= 0) {
155 i = sens->index2 * 2;
180 struct wf_sat_sensor *sens = wf_to_sat(sr);
181 struct wf_sat *sat = sens->sat;
183 kfree(sens);
198 struct wf_sat_sensor *sens;
265 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
266 if (sens == NULL) {
271 sens->index = index;
272 sens->index2 = -1;
273 sens->shift = shift;
274 sens->sat = sat;
275 sens->sens.ops = &wf_sat_ops;
276 sens->sens.name = (char *) (sens + 1);
277 snprintf((char *)sens->sens.name, 16, "%s-%d", name, cpu);
279 if (wf_register_sensor(&sens->sens))
280 kfree(sens);
282 list_add(&sens->link, &sat->sensors);
292 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
293 if (sens == NULL) {
298 sens->index = vsens[core];
299 sens->index2 = isens[core];
300 sens->shift = 0;
301 sens->sat = sat;
302 sens->sens.ops = &wf_sat_ops;
303 sens->sens.name = (char *) (sens + 1);
304 snprintf((char *)sens->sens.name, 16, "cpu-power-%d", cpu);
306 if (wf_register_sensor(&sens->sens))
307 kfree(sens);
309 list_add(&sens->link, &sat->sensors);
323 struct wf_sat_sensor *sens;
327 sens = list_first_entry(&sat->sensors,
329 list_del(&sens->link);
330 wf_unregister_sensor(&sens->sens);