File lincdadrv_printk.diff of Package degirum
diff --git a/src/cdadrv.c b/src/cdadrv.c
index e4c7b58..c1c501c 100644
--- a/src/cdadrv.c
+++ b/src/cdadrv.c
@@ -7,6 +7,9 @@
// under the terms and conditions of the GNU General Public License,
// version 2, as published by the Free Software Foundation.
//
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/init.h>
@@ -363,7 +366,7 @@ static int __init cdadrv_init(void)
size_t pci_id_table_size = ARRAY_SIZE(cda_pci_ids);
if (test_probe) {
- printk("Test run. Nothing initialized\n");
+ pr_info("Test run. Nothing initialized\n");
return 0;
}
@@ -398,7 +401,7 @@ err_alloc_cdev_reg:
static void __exit dcadrv_exit(void)
{
if (test_probe) {
- printk("Stop test run. Nothing initialized\n");
+ pr_info("Stop test run. Nothing initialized\n");
return;
}
pci_unregister_driver(&cda_pci);
diff --git a/src/cdamem.c b/src/cdamem.c
index ed39573..b80a4ba 100644
--- a/src/cdamem.c
+++ b/src/cdamem.c
@@ -320,7 +320,7 @@ memmap_sglist_show(struct cda_mmap *memmap, char *buf)
for ( ; i < memmap->blk_cnt; i++) {
if ((res + sg_list_item_size) >= (PAGE_SIZE - 1)) /* https://lwn.net/Articles/178634/ */{
memmap->show_cnt = i;
- //printk("Split SG list. Next read starts with item: %d\n", i);
+ dev_dbg(&memmap->dev->dev, "Split SG list. Next read starts with item: %d\n", i);
break;
}
res += sprintf(&buf[res], "%016llx %08lx\n", memmap->sg_list[i].paddr, memmap->sg_list[i].size);