Lines Matching refs:sens
53 struct wf_sensor sens;
56 #define wf_to_sat(c) container_of(c, struct wf_sat_sensor, sens)
173 struct wf_sat_sensor *sens = wf_to_sat(sr);
174 struct wf_sat *sat = sens->sat;
188 i = sens->index * 2;
189 val = ((sat->cache[i] << 8) + sat->cache[i+1]) << sens->shift;
190 if (sens->index2 >= 0) {
191 i = sens->index2 * 2;
206 struct wf_sat_sensor *sens = wf_to_sat(sr);
207 struct wf_sat *sat = sens->sat;
218 kfree(sens);
230 struct wf_sat_sensor *sens;
311 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
312 if (sens == NULL) {
317 sens->index = index;
318 sens->index2 = -1;
319 sens->shift = shift;
320 sens->sat = sat;
322 sens->sens.ops = &wf_sat_ops;
323 sens->sens.name = (char *) (sens + 1);
324 snprintf(sens->sens.name, 16, "%s-%d", name, cpu);
326 if (wf_register_sensor(&sens->sens)) {
328 kfree(sens);
337 sens = kzalloc(sizeof(struct wf_sat_sensor) + 16, GFP_KERNEL);
338 if (sens == NULL) {
343 sens->index = vsens[core];
344 sens->index2 = isens[core];
345 sens->shift = 0;
346 sens->sat = sat;
348 sens->sens.ops = &wf_sat_ops;
349 sens->sens.name = (char *) (sens + 1);
350 snprintf(sens->sens.name, 16, "cpu-power-%d", cpu);
352 if (wf_register_sensor(&sens->sens)) {
354 kfree(sens);