| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Remote processor messaging - sample client driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Ohad Ben-Cohen <ohad@wizery.com> |
|---|
| 8 | 9 | * 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. |
|---|
| 18 | 10 | */ |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 22 | 14 | #include <linux/rpmsg.h> |
|---|
| 23 | 15 | |
|---|
| 24 | 16 | #define MSG "hello world!" |
|---|
| 25 | | -#define MSG_LIMIT 100 |
|---|
| 17 | + |
|---|
| 18 | +static int count = 100; |
|---|
| 19 | +module_param(count, int, 0644); |
|---|
| 26 | 20 | |
|---|
| 27 | 21 | struct instance_data { |
|---|
| 28 | 22 | int rx_count; |
|---|
| .. | .. |
|---|
| 37 | 31 | dev_info(&rpdev->dev, "incoming msg %d (src: 0x%x)\n", |
|---|
| 38 | 32 | ++idata->rx_count, src); |
|---|
| 39 | 33 | |
|---|
| 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); |
|---|
| 42 | 36 | |
|---|
| 43 | 37 | /* samples should not live forever */ |
|---|
| 44 | | - if (idata->rx_count >= MSG_LIMIT) { |
|---|
| 38 | + if (idata->rx_count >= count) { |
|---|
| 45 | 39 | dev_info(&rpdev->dev, "goodbye!\n"); |
|---|
| 46 | 40 | return 0; |
|---|
| 47 | 41 | } |
|---|