Commit cc38b8e9 authored by YAMANE Toshiaki's avatar YAMANE Toshiaki Committed by Mauro Carvalho Chehab

[media] staging/media: Use pr_ printks in lirc/lirc_parallel.c

fixed below checkpatch warnings.
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...
- WARNING: Prefer netdev_notice(netdev, ... then dev_notice(dev, ... then pr_notice(...  to printk(KERN_NOTICE ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
and add pr_fmt.
Signed-off-by: default avatarYAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f8a7df00
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
/*** Includes ***/ /*** Includes ***/
#include <linux/module.h> #include <linux/module.h>
...@@ -115,8 +117,7 @@ static void out(int offset, int value) ...@@ -115,8 +117,7 @@ static void out(int offset, int value)
parport_write_control(pport, value); parport_write_control(pport, value);
break; break;
case LIRC_LP_STATUS: case LIRC_LP_STATUS:
printk(KERN_INFO "%s: attempt to write to status register\n", pr_info("attempt to write to status register\n");
LIRC_DRIVER_NAME);
break; break;
} }
} }
...@@ -166,27 +167,23 @@ static unsigned int init_lirc_timer(void) ...@@ -166,27 +167,23 @@ static unsigned int init_lirc_timer(void)
if (default_timer == 0) { if (default_timer == 0) {
/* autodetect timer */ /* autodetect timer */
newtimer = (1000000*count)/timeelapsed; newtimer = (1000000*count)/timeelapsed;
printk(KERN_INFO "%s: %u Hz timer detected\n", pr_info("%u Hz timer detected\n", newtimer);
LIRC_DRIVER_NAME, newtimer);
return newtimer; return newtimer;
} else { } else {
newtimer = (1000000*count)/timeelapsed; newtimer = (1000000*count)/timeelapsed;
if (abs(newtimer - default_timer) > default_timer/10) { if (abs(newtimer - default_timer) > default_timer/10) {
/* bad timer */ /* bad timer */
printk(KERN_NOTICE "%s: bad timer: %u Hz\n", pr_notice("bad timer: %u Hz\n", newtimer);
LIRC_DRIVER_NAME, newtimer); pr_notice("using default timer: %u Hz\n",
printk(KERN_NOTICE "%s: using default timer: " default_timer);
"%u Hz\n",
LIRC_DRIVER_NAME, default_timer);
return default_timer; return default_timer;
} else { } else {
printk(KERN_INFO "%s: %u Hz timer detected\n", pr_info("%u Hz timer detected\n", newtimer);
LIRC_DRIVER_NAME, newtimer);
return newtimer; /* use detected value */ return newtimer; /* use detected value */
} }
} }
} else { } else {
printk(KERN_NOTICE "%s: no timer detected\n", LIRC_DRIVER_NAME); pr_notice("no timer detected\n");
return 0; return 0;
} }
} }
...@@ -194,13 +191,10 @@ static unsigned int init_lirc_timer(void) ...@@ -194,13 +191,10 @@ static unsigned int init_lirc_timer(void)
static int lirc_claim(void) static int lirc_claim(void)
{ {
if (parport_claim(ppdevice) != 0) { if (parport_claim(ppdevice) != 0) {
printk(KERN_WARNING "%s: could not claim port\n", pr_warn("could not claim port\n");
LIRC_DRIVER_NAME); pr_warn("waiting for port becoming available\n");
printk(KERN_WARNING "%s: waiting for port becoming available"
"\n", LIRC_DRIVER_NAME);
if (parport_claim_or_block(ppdevice) < 0) { if (parport_claim_or_block(ppdevice) < 0) {
printk(KERN_NOTICE "%s: could not claim port, giving" pr_notice("could not claim port, giving up\n");
" up\n", LIRC_DRIVER_NAME);
return 0; return 0;
} }
} }
...@@ -219,7 +213,7 @@ static void rbuf_write(int signal) ...@@ -219,7 +213,7 @@ static void rbuf_write(int signal)
if (nwptr == rptr) { if (nwptr == rptr) {
/* no new signals will be accepted */ /* no new signals will be accepted */
lost_irqs++; lost_irqs++;
printk(KERN_NOTICE "%s: buffer overrun\n", LIRC_DRIVER_NAME); pr_notice("buffer overrun\n");
return; return;
} }
rbuf[wptr] = signal; rbuf[wptr] = signal;
...@@ -290,7 +284,7 @@ static void irq_handler(void *blah) ...@@ -290,7 +284,7 @@ static void irq_handler(void *blah)
if (signal > timeout if (signal > timeout
|| (check_pselecd && (in(1) & LP_PSELECD))) { || (check_pselecd && (in(1) & LP_PSELECD))) {
signal = 0; signal = 0;
printk(KERN_NOTICE "%s: timeout\n", LIRC_DRIVER_NAME); pr_notice("timeout\n");
break; break;
} }
} while (lirc_get_signal()); } while (lirc_get_signal());
...@@ -644,8 +638,7 @@ static int __init lirc_parallel_init(void) ...@@ -644,8 +638,7 @@ static int __init lirc_parallel_init(void)
result = platform_driver_register(&lirc_parallel_driver); result = platform_driver_register(&lirc_parallel_driver);
if (result) { if (result) {
printk(KERN_NOTICE "platform_driver_register" pr_notice("platform_driver_register returned %d\n", result);
" returned %d\n", result);
return result; return result;
} }
...@@ -661,8 +654,7 @@ static int __init lirc_parallel_init(void) ...@@ -661,8 +654,7 @@ static int __init lirc_parallel_init(void)
pport = parport_find_base(io); pport = parport_find_base(io);
if (pport == NULL) { if (pport == NULL) {
printk(KERN_NOTICE "%s: no port at %x found\n", pr_notice("no port at %x found\n", io);
LIRC_DRIVER_NAME, io);
result = -ENXIO; result = -ENXIO;
goto exit_device_put; goto exit_device_put;
} }
...@@ -670,8 +662,7 @@ static int __init lirc_parallel_init(void) ...@@ -670,8 +662,7 @@ static int __init lirc_parallel_init(void)
pf, kf, irq_handler, 0, NULL); pf, kf, irq_handler, 0, NULL);
parport_put_port(pport); parport_put_port(pport);
if (ppdevice == NULL) { if (ppdevice == NULL) {
printk(KERN_NOTICE "%s: parport_register_device() failed\n", pr_notice("parport_register_device() failed\n");
LIRC_DRIVER_NAME);
result = -ENXIO; result = -ENXIO;
goto exit_device_put; goto exit_device_put;
} }
...@@ -706,14 +697,12 @@ static int __init lirc_parallel_init(void) ...@@ -706,14 +697,12 @@ static int __init lirc_parallel_init(void)
driver.dev = &lirc_parallel_dev->dev; driver.dev = &lirc_parallel_dev->dev;
driver.minor = lirc_register_driver(&driver); driver.minor = lirc_register_driver(&driver);
if (driver.minor < 0) { if (driver.minor < 0) {
printk(KERN_NOTICE "%s: register_chrdev() failed\n", pr_notice("register_chrdev() failed\n");
LIRC_DRIVER_NAME);
parport_unregister_device(ppdevice); parport_unregister_device(ppdevice);
result = -EIO; result = -EIO;
goto exit_device_put; goto exit_device_put;
} }
printk(KERN_INFO "%s: installed using port 0x%04x irq %d\n", pr_info("installed using port 0x%04x irq %d\n", io, irq);
LIRC_DRIVER_NAME, io, irq);
return 0; return 0;
exit_device_put: exit_device_put:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment