Skip to content

Commit 9a703eb

Browse files
sumanannaandersson
authored andcommitted
samples/rpmsg: Introduce a module parameter for message count
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> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
1 parent 2519fbb commit 9a703eb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎samples/rpmsg/rpmsg_client_sample.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
#include <linux/rpmsg.h>
1515

1616
#define MSG "hello world!"
17-
#define MSG_LIMIT 100
17+
18+
static int count = 100;
19+
module_param(count, int, 0644);
1820

1921
struct instance_data {
2022
int rx_count;
@@ -33,7 +35,7 @@ static int rpmsg_sample_cb(struct rpmsg_device *rpdev, void *data, int len,
3335
true);
3436

3537
/* samples should not live forever */
36-
if (idata->rx_count >= MSG_LIMIT) {
38+
if (idata->rx_count >= count) {
3739
dev_info(&rpdev->dev, "goodbye!\n");
3840
return 0;
3941
}

0 commit comments

Comments
 (0)