hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/samples/rpmsg/rpmsg_client_sample.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Remote processor messaging - sample client driver
34 *
....@@ -6,15 +7,6 @@
67 *
78 * Ohad Ben-Cohen <ohad@wizery.com>
89 * Brian Swetland <swetland@google.com>
9
- *
10
- * This software is licensed under the terms of the GNU General Public
11
- * License version 2, as published by the Free Software Foundation, and
12
- * may be copied, distributed, and modified under those terms.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
1810 */
1911
2012 #include <linux/kernel.h>
....@@ -22,7 +14,9 @@
2214 #include <linux/rpmsg.h>
2315
2416 #define MSG "hello world!"
25
-#define MSG_LIMIT 100
17
+
18
+static int count = 100;
19
+module_param(count, int, 0644);
2620
2721 struct instance_data {
2822 int rx_count;
....@@ -37,11 +31,11 @@
3731 dev_info(&rpdev->dev, "incoming msg %d (src: 0x%x)\n",
3832 ++idata->rx_count, src);
3933
40
- print_hex_dump(KERN_DEBUG, __func__, DUMP_PREFIX_NONE, 16, 1,
41
- data, len, true);
34
+ print_hex_dump_debug(__func__, DUMP_PREFIX_NONE, 16, 1, data, len,
35
+ true);
4236
4337 /* samples should not live forever */
44
- if (idata->rx_count >= MSG_LIMIT) {
38
+ if (idata->rx_count >= count) {
4539 dev_info(&rpdev->dev, "goodbye!\n");
4640 return 0;
4741 }