summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/loopback.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2015-07-22 20:09:23 +0200
committerGreg Kroah-Hartman2015-07-25 01:14:43 +0200
commitc2939f41bca86d30388e6fa48e469a4e748b71e2 (patch)
tree2919a71006ecc4b421b4683ac63f7ae1639bc0f7 /drivers/staging/greybus/loopback.c
parentgreybus: operation: add completion work queue (diff)
downloadkernel-qcow2-linux-c2939f41bca86d30388e6fa48e469a4e748b71e2.tar.gz
kernel-qcow2-linux-c2939f41bca86d30388e6fa48e469a4e748b71e2.tar.xz
kernel-qcow2-linux-c2939f41bca86d30388e6fa48e469a4e748b71e2.zip
greybus: loopback: add poll support to the iteration_count sysfs file
This adds the ability to poll on "iteration_count" in sysfs and be woken up when it changes, saving some cycles constantly hammering on the file waiting for it to change. Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Diffstat (limited to 'drivers/staging/greybus/loopback.c')
-rw-r--r--drivers/staging/greybus/loopback.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 50eacd1e11a3..08f0bee198c2 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -141,7 +141,6 @@ gb_loopback_stats_attrs(throughput);
gb_loopback_ro_attr(error, d);
/* The current index of the for (i = 0; i < iteration_max; i++) loop */
gb_loopback_ro_attr(iteration_count, u);
-/* TODO iteration_count might be better with the KOBJ_CHANGE event */
/*
* Type of loopback message to send based on protocol type definitions
@@ -406,6 +405,8 @@ static int gb_loopback_fn(void *data)
if (gb->iteration_max) {
if (gb->iteration_count < gb->iteration_max) {
gb->iteration_count++;
+ sysfs_notify(&gb->connection->dev.kobj, NULL,
+ "iteration_count");
} else {
gb->type = 0;
continue;