Skip to content

Commit 49a6c14

Browse files
committed
drivers: tty: serial: apbuart: fix logging calls
Fix checkpatch warnings: WARNING: Prefer using '"%s...", __func__' to using 'apbuart_console_setup', this function's name, in a string torvalds#491: FILE: drivers/tty/serial/apbuart.c:491: + pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s\n", WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... torvalds#661: FILE: drivers/tty/serial/apbuart.c:661: + printk(KERN_INFO "Serial: GRLIB APBUART driver\n"); WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... torvalds#666: FILE: drivers/tty/serial/apbuart.c:666: + printk(KERN_ERR "%s: uart_register_driver failed (%i)\n", WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... torvalds#673: FILE: drivers/tty/serial/apbuart.c:673: + printk(KERN_ERR Signed-off-by: Enrico Weigelt <[email protected]>
1 parent 7196f7e commit 49a6c14

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

drivers/tty/serial/apbuart.c

+7-8
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ static int __init apbuart_console_setup(struct console *co, char *options)
478478
int parity = 'n';
479479
int flow = 'n';
480480

481-
pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s\n",
482-
co, co->index, options);
481+
pr_debug("%s() co=%p, co->index=%i, options=%s\n",
482+
__func__, co, co->index, options);
483483

484484
/*
485485
* Check whether an invalid uart number has been specified, and
@@ -647,21 +647,20 @@ static int __init grlib_apbuart_init(void)
647647
if (ret)
648648
return ret;
649649

650-
printk(KERN_INFO "Serial: GRLIB APBUART driver\n");
650+
pr_info("Serial: GRLIB APBUART driver\n");
651651

652652
ret = uart_register_driver(&grlib_apbuart_driver);
653653

654654
if (ret) {
655-
printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
656-
__FILE__, ret);
655+
pr_err("%s: uart_register_driver failed (%i)\n",
656+
__func__, ret);
657657
return ret;
658658
}
659659

660660
ret = platform_driver_register(&grlib_apbuart_of_driver);
661661
if (ret) {
662-
printk(KERN_ERR
663-
"%s: platform_driver_register failed (%i)\n",
664-
__FILE__, ret);
662+
pr_err("%s: platform_driver_register failed (%i)\n",
663+
__func__, ret);
665664
uart_unregister_driver(&grlib_apbuart_driver);
666665
return ret;
667666
}

0 commit comments

Comments
 (0)