Skip to content

Commit 9d4565e

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 c28e452 commit 9d4565e

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
@@ -482,8 +482,8 @@ static int __init apbuart_console_setup(struct console *co, char *options)
482482
int parity = 'n';
483483
int flow = 'n';
484484

485-
pr_debug("apbuart_console_setup co=%p, co->index=%i, options=%s\n",
486-
co, co->index, options);
485+
pr_debug("%s() co=%p, co->index=%i, options=%s\n",
486+
__func__, co, co->index, options);
487487

488488
/*
489489
* Check whether an invalid uart number has been specified, and
@@ -650,21 +650,20 @@ static int __init grlib_apbuart_init(void)
650650
if (ret)
651651
return ret;
652652

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

655655
ret = uart_register_driver(&grlib_apbuart_driver);
656656

657657
if (ret) {
658-
printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
659-
__FILE__, ret);
658+
pr_err("%s: uart_register_driver failed (%i)\n",
659+
__func__, ret);
660660
return ret;
661661
}
662662

663663
ret = platform_driver_register(&grlib_apbuart_of_driver);
664664
if (ret) {
665-
printk(KERN_ERR
666-
"%s: platform_driver_register failed (%i)\n",
667-
__FILE__, ret);
665+
pr_err("%s: platform_driver_register failed (%i)\n",
666+
__func__, ret);
668667
uart_unregister_driver(&grlib_apbuart_driver);
669668
return ret;
670669
}

0 commit comments

Comments
 (0)