Lines Matching refs:sysfsfp
92 FILE *sysfsfp; in iioutils_get_type() local
132 sysfsfp = fopen(filename, "r"); in iioutils_get_type()
133 if (!sysfsfp) { in iioutils_get_type()
140 ret = fscanf(sysfsfp, in iioutils_get_type()
166 if (fclose(sysfsfp)) { in iioutils_get_type()
173 sysfsfp = 0; in iioutils_get_type()
186 if (sysfsfp) in iioutils_get_type()
187 if (fclose(sysfsfp)) in iioutils_get_type()
222 FILE *sysfsfp; in iioutils_get_param_float() local
257 sysfsfp = fopen(filename, "r"); in iioutils_get_param_float()
258 if (!sysfsfp) { in iioutils_get_param_float()
264 if (fscanf(sysfsfp, "%f", output) != 1) in iioutils_get_param_float()
267 fclose(sysfsfp); in iioutils_get_param_float()
319 FILE *sysfsfp; in build_channel_array() local
348 sysfsfp = fopen(filename, "r"); in build_channel_array()
350 if (!sysfsfp) { in build_channel_array()
356 if (fscanf(sysfsfp, "%i", &ret) != 1) { in build_channel_array()
358 if (fclose(sysfsfp)) in build_channel_array()
366 if (fclose(sysfsfp)) { in build_channel_array()
395 sysfsfp = fopen(filename, "r"); in build_channel_array()
397 if (!sysfsfp) { in build_channel_array()
404 if (fscanf(sysfsfp, "%i", ¤t_enabled) != 1) { in build_channel_array()
410 if (fclose(sysfsfp)) { in build_channel_array()
450 sysfsfp = fopen(filename, "r"); in build_channel_array()
452 if (!sysfsfp) { in build_channel_array()
460 if (fscanf(sysfsfp, "%u", ¤t->index) != 1) { in build_channel_array()
462 if (fclose(sysfsfp)) in build_channel_array()
468 if (fclose(sysfsfp)) { in build_channel_array()
656 FILE *sysfsfp; in _write_sysfs_int() local
667 sysfsfp = fopen(temp, "w"); in _write_sysfs_int()
668 if (!sysfsfp) { in _write_sysfs_int()
674 ret = fprintf(sysfsfp, "%d", val); in _write_sysfs_int()
676 if (fclose(sysfsfp)) in _write_sysfs_int()
682 if (fclose(sysfsfp)) { in _write_sysfs_int()
688 sysfsfp = fopen(temp, "r"); in _write_sysfs_int()
689 if (!sysfsfp) { in _write_sysfs_int()
695 if (fscanf(sysfsfp, "%d", &test) != 1) { in _write_sysfs_int()
697 if (fclose(sysfsfp)) in _write_sysfs_int()
703 if (fclose(sysfsfp)) { in _write_sysfs_int()
753 FILE *sysfsfp; in _write_sysfs_string() local
765 sysfsfp = fopen(temp, "w"); in _write_sysfs_string()
766 if (!sysfsfp) { in _write_sysfs_string()
772 ret = fprintf(sysfsfp, "%s", val); in _write_sysfs_string()
774 if (fclose(sysfsfp)) in _write_sysfs_string()
780 if (fclose(sysfsfp)) { in _write_sysfs_string()
786 sysfsfp = fopen(temp, "r"); in _write_sysfs_string()
787 if (!sysfsfp) { in _write_sysfs_string()
793 if (fscanf(sysfsfp, "%s", temp) != 1) { in _write_sysfs_string()
795 if (fclose(sysfsfp)) in _write_sysfs_string()
801 if (fclose(sysfsfp)) { in _write_sysfs_string()
860 FILE *sysfsfp; in read_sysfs_posint() local
872 sysfsfp = fopen(temp, "r"); in read_sysfs_posint()
873 if (!sysfsfp) { in read_sysfs_posint()
879 if (fscanf(sysfsfp, "%d\n", &ret) != 1) { in read_sysfs_posint()
881 if (fclose(sysfsfp)) in read_sysfs_posint()
887 if (fclose(sysfsfp)) in read_sysfs_posint()
907 FILE *sysfsfp; in read_sysfs_float() local
919 sysfsfp = fopen(temp, "r"); in read_sysfs_float()
920 if (!sysfsfp) { in read_sysfs_float()
926 if (fscanf(sysfsfp, "%f\n", val) != 1) { in read_sysfs_float()
928 if (fclose(sysfsfp)) in read_sysfs_float()
934 if (fclose(sysfsfp)) in read_sysfs_float()
954 FILE *sysfsfp; in read_sysfs_string() local
966 sysfsfp = fopen(temp, "r"); in read_sysfs_string()
967 if (!sysfsfp) { in read_sysfs_string()
973 if (fscanf(sysfsfp, "%s\n", str) != 1) { in read_sysfs_string()
975 if (fclose(sysfsfp)) in read_sysfs_string()
981 if (fclose(sysfsfp)) in read_sysfs_string()