]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
samples/rpmsg: Introduce a module parameter for message count
authorSuman Anna <s-anna@ti.com>
Wed, 18 Jul 2018 21:44:55 +0000 (16:44 -0500)
committerSuman Anna <s-anna@ti.com>
Wed, 19 Dec 2018 03:16:28 +0000 (21:16 -0600)
The current rpmsg_client_sample uses a fixed number of messages to
be sent to each instance. This is currently set at 100. Introduce
an optional module parameter 'count' so that the number of messages
to be exchanged can be made flexible.

Signed-off-by: Suman Anna <s-anna@ti.com>
samples/rpmsg/rpmsg_client_sample.c

index f161dfd3e70a7aaf575e022f4390762f0608a9bc..9b6b27ea504f472b06a84f71ee392728b9889251 100644 (file)
@@ -22,7 +22,9 @@
 #include <linux/rpmsg.h>
 
 #define MSG            "hello world!"
-#define MSG_LIMIT      100
+
+static int count = 100;
+module_param(count, int, 0644);
 
 struct instance_data {
        int rx_count;
@@ -41,7 +43,7 @@ static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len,
                       data, len,  true);
 
        /* samples should not live forever */
-       if (idata->rx_count >= MSG_LIMIT) {
+       if (idata->rx_count >= count) {
                dev_info(&rpdev->dev, "goodbye!\n");
                return 0;
        }