Lines Matching refs: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);
197 struct wf_sat_sensor *sens;
264 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
265 if (sens == NULL) {
270 sens->index = index;
271 sens->index2 = -1;
272 sens->shift = shift;
273 sens->sat = sat;
274 sens->sens.ops = &wf_sat_ops;
275 sens->sens.name = (char *) (sens + 1);
276 snprintf((char *)sens->sens.name, 16, "%s-%d", name, cpu);
278 if (wf_register_sensor(&sens->sens))
279 kfree(sens);
281 list_add(&sens->link, &sat->sensors);
291 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
292 if (sens == NULL) {
297 sens->index = vsens[core];
298 sens->index2 = isens[core];
299 sens->shift = 0;
300 sens->sat = sat;
301 sens->sens.ops = &wf_sat_ops;
302 sens->sens.name = (char *) (sens + 1);
303 snprintf((char *)sens->sens.name, 16, "cpu-power-%d", cpu);
305 if (wf_register_sensor(&sens->sens))
306 kfree(sens);
308 list_add(&sens->link, &sat->sensors);
322 struct wf_sat_sensor *sens;
326 sens = list_first_entry(&sat->sensors,
328 list_del(&sens->link);
329 wf_unregister_sensor(&sens->sens);