]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/blobdiff - samples/rpmsg/rpmsg_client_sample.c
samples/rpmsg: Introduce a module parameter for message count
[rpmsg/rpmsg.git] / 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;
        }