Title: [8781] trunk/drivers/staging/iio/Documentation/iio_utils.h: staging:iio: Documentation, update iio_utils.h for the move to a bus
- Revision
- 8781
- Author
- vapier
- Date
- 2010-05-22 23:41:14 -0400 (Sat, 22 May 2010)
Log Message
staging:iio: Documentation, update iio_utils.h for the move to a bus
From: Jonathan Cameron <[email protected]>
Modified Paths
Diff
Modified: trunk/drivers/staging/iio/Documentation/iio_utils.h (8780 => 8781)
--- trunk/drivers/staging/iio/Documentation/iio_utils.h 2010-05-23 03:40:51 UTC (rev 8780)
+++ trunk/drivers/staging/iio/Documentation/iio_utils.h 2010-05-23 03:41:14 UTC (rev 8781)
@@ -47,7 +47,7 @@
char *find_type_by_name(const char *name, const char *type)
{
- const char *iio_dir = "/sys/class/iio/";
+ const char *iio_dir = "/sys/bus/iio/devices/";
const struct dirent *ent;
int cnt, pos, pos2;
@@ -112,6 +112,35 @@
return 0;
}
+int write_sysfs_int_and_verify(char *filename, char *basedir, int val)
+{
+ int ret;
+ FILE *sysfsfp;
+ char temp[100];
+ int test;
+
+ sprintf(temp, "%s%s", basedir, filename);
+ sysfsfp = fopen(temp, "w");
+ if (sysfsfp == NULL)
+ return -1;
+ fprintf(sysfsfp, "%d", val);
+ fclose(sysfsfp);
+
+ sysfsfp = fopen(temp, "r");
+ if (sysfsfp == NULL)
+ return -1;
+ fscanf(sysfsfp, "%d", &test);
+ if (test != val) {
+ printf("Possible failure in int write %d to %s%s\n",
+ val,
+ basedir,
+ filename);
+ return -1;
+ }
+
+ return 0;
+}
+
/**
* write_sysfs_string_and_verify() - string write, readback and verify
* @filename: name of file to write to
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits