Skip to content

Commit

Permalink
drivers: tty: serial: apbuart: fix logging calls
Browse files Browse the repository at this point in the history
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 <info@metux.net>
  • Loading branch information
metux committed Jan 10, 2020
1 parent 55f6e94 commit 312fa73
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/tty/serial/apbuart.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,8 @@ static int __init apbuart_console_setup(struct console *co, char *options)
int parity = 'n';
int flow = 'n';

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

/*
* Check whether an invalid uart number has been specified, and
Expand Down Expand Up @@ -650,21 +650,20 @@ static int __init grlib_apbuart_init(void)
if (ret)
return ret;

printk(KERN_INFO "Serial: GRLIB APBUART driver\n");
pr_info("Serial: GRLIB APBUART driver\n");

ret = uart_register_driver(&grlib_apbuart_driver);

if (ret) {
printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
__FILE__, ret);
pr_err("%s: uart_register_driver failed (%i)\n",
__func__, ret);
return ret;
}

ret = platform_driver_register(&grlib_apbuart_of_driver);
if (ret) {
printk(KERN_ERR
"%s: platform_driver_register failed (%i)\n",
__FILE__, ret);
pr_err("%s: platform_driver_register failed (%i)\n",
__func__, ret);
uart_unregister_driver(&grlib_apbuart_driver);
return ret;
}
Expand Down

0 comments on commit 312fa73

Please sign in to comment.