[media] staging/media: Use pr_ printks in lirc/lirc_serial.c
fixed below checkpatch warnings. - WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(... to printk(KERN_WARNING ... - WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... - WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... and add pr_fmt. Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
cc38b8e9f5
commit
df4f07b506
1 changed files with 29 additions and 41 deletions
|
@ -48,6 +48,8 @@
|
||||||
* Steve Davies <steve@daviesfam.org> July 2001
|
* Steve Davies <steve@daviesfam.org> July 2001
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/signal.h>
|
#include <linux/signal.h>
|
||||||
|
@ -667,8 +669,7 @@ static irqreturn_t irq_handler(int i, void *blah)
|
||||||
counter++;
|
counter++;
|
||||||
status = sinp(UART_MSR);
|
status = sinp(UART_MSR);
|
||||||
if (counter > RS_ISR_PASS_LIMIT) {
|
if (counter > RS_ISR_PASS_LIMIT) {
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME ": AIEEEE: "
|
pr_warn("AIEEEE: We're caught!\n");
|
||||||
"We're caught!\n");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((status & hardware[type].signal_pin_change)
|
if ((status & hardware[type].signal_pin_change)
|
||||||
|
@ -703,11 +704,10 @@ static irqreturn_t irq_handler(int i, void *blah)
|
||||||
dcd = (status & hardware[type].signal_pin) ? 1 : 0;
|
dcd = (status & hardware[type].signal_pin) ? 1 : 0;
|
||||||
|
|
||||||
if (dcd == last_dcd) {
|
if (dcd == last_dcd) {
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
pr_warn("ignoring spike: %d %d %lx %lx %lx %lx\n",
|
||||||
": ignoring spike: %d %d %lx %lx %lx %lx\n",
|
dcd, sense,
|
||||||
dcd, sense,
|
tv.tv_sec, lasttv.tv_sec,
|
||||||
tv.tv_sec, lasttv.tv_sec,
|
tv.tv_usec, lasttv.tv_usec);
|
||||||
tv.tv_usec, lasttv.tv_usec);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,25 +715,20 @@ static irqreturn_t irq_handler(int i, void *blah)
|
||||||
if (tv.tv_sec < lasttv.tv_sec ||
|
if (tv.tv_sec < lasttv.tv_sec ||
|
||||||
(tv.tv_sec == lasttv.tv_sec &&
|
(tv.tv_sec == lasttv.tv_sec &&
|
||||||
tv.tv_usec < lasttv.tv_usec)) {
|
tv.tv_usec < lasttv.tv_usec)) {
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
pr_warn("AIEEEE: your clock just jumped backwards\n");
|
||||||
": AIEEEE: your clock just jumped "
|
pr_warn("%d %d %lx %lx %lx %lx\n",
|
||||||
"backwards\n");
|
dcd, sense,
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
tv.tv_sec, lasttv.tv_sec,
|
||||||
": %d %d %lx %lx %lx %lx\n",
|
tv.tv_usec, lasttv.tv_usec);
|
||||||
dcd, sense,
|
|
||||||
tv.tv_sec, lasttv.tv_sec,
|
|
||||||
tv.tv_usec, lasttv.tv_usec);
|
|
||||||
data = PULSE_MASK;
|
data = PULSE_MASK;
|
||||||
} else if (deltv > 15) {
|
} else if (deltv > 15) {
|
||||||
data = PULSE_MASK; /* really long time */
|
data = PULSE_MASK; /* really long time */
|
||||||
if (!(dcd^sense)) {
|
if (!(dcd^sense)) {
|
||||||
/* sanity check */
|
/* sanity check */
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
pr_warn("AIEEEE: %d %d %lx %lx %lx %lx\n",
|
||||||
": AIEEEE: "
|
dcd, sense,
|
||||||
"%d %d %lx %lx %lx %lx\n",
|
tv.tv_sec, lasttv.tv_sec,
|
||||||
dcd, sense,
|
tv.tv_usec, lasttv.tv_usec);
|
||||||
tv.tv_sec, lasttv.tv_sec,
|
|
||||||
tv.tv_usec, lasttv.tv_usec);
|
|
||||||
/*
|
/*
|
||||||
* detecting pulse while this
|
* detecting pulse while this
|
||||||
* MUST be a space!
|
* MUST be a space!
|
||||||
|
@ -776,8 +771,7 @@ static int hardware_init_port(void)
|
||||||
soutp(UART_IER, scratch);
|
soutp(UART_IER, scratch);
|
||||||
if (scratch2 != 0 || scratch3 != 0x0f) {
|
if (scratch2 != 0 || scratch3 != 0x0f) {
|
||||||
/* we fail, there's nothing here */
|
/* we fail, there's nothing here */
|
||||||
printk(KERN_ERR LIRC_DRIVER_NAME ": port existence test "
|
pr_err("port existence test failed, cannot continue\n");
|
||||||
"failed, cannot continue\n");
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,11 +844,9 @@ static int __devinit lirc_serial_probe(struct platform_device *dev)
|
||||||
LIRC_DRIVER_NAME, (void *)&hardware);
|
LIRC_DRIVER_NAME, (void *)&hardware);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (result == -EBUSY)
|
if (result == -EBUSY)
|
||||||
printk(KERN_ERR LIRC_DRIVER_NAME ": IRQ %d busy\n",
|
dev_err(&dev->dev, "IRQ %d busy\n", irq);
|
||||||
irq);
|
|
||||||
else if (result == -EINVAL)
|
else if (result == -EINVAL)
|
||||||
printk(KERN_ERR LIRC_DRIVER_NAME
|
dev_err(&dev->dev, "Bad irq number or handler\n");
|
||||||
": Bad irq number or handler\n");
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -869,14 +861,11 @@ static int __devinit lirc_serial_probe(struct platform_device *dev)
|
||||||
LIRC_DRIVER_NAME) == NULL))
|
LIRC_DRIVER_NAME) == NULL))
|
||||||
|| ((iommap == 0)
|
|| ((iommap == 0)
|
||||||
&& (request_region(io, 8, LIRC_DRIVER_NAME) == NULL))) {
|
&& (request_region(io, 8, LIRC_DRIVER_NAME) == NULL))) {
|
||||||
printk(KERN_ERR LIRC_DRIVER_NAME
|
dev_err(&dev->dev, "port %04x already in use\n", io);
|
||||||
": port %04x already in use\n", io);
|
dev_warn(&dev->dev, "use 'setserial /dev/ttySX uart none'\n");
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
dev_warn(&dev->dev,
|
||||||
": use 'setserial /dev/ttySX uart none'\n");
|
"or compile the serial port driver as module and\n");
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
dev_warn(&dev->dev, "make sure this module is loaded first\n");
|
||||||
": or compile the serial port driver as module and\n");
|
|
||||||
printk(KERN_WARNING LIRC_DRIVER_NAME
|
|
||||||
": make sure this module is loaded first\n");
|
|
||||||
result = -EBUSY;
|
result = -EBUSY;
|
||||||
goto exit_free_irq;
|
goto exit_free_irq;
|
||||||
}
|
}
|
||||||
|
@ -907,11 +896,11 @@ static int __devinit lirc_serial_probe(struct platform_device *dev)
|
||||||
msleep(40);
|
msleep(40);
|
||||||
}
|
}
|
||||||
sense = (nlow >= nhigh ? 1 : 0);
|
sense = (nlow >= nhigh ? 1 : 0);
|
||||||
printk(KERN_INFO LIRC_DRIVER_NAME ": auto-detected active "
|
dev_info(&dev->dev, "auto-detected active %s receiver\n",
|
||||||
"%s receiver\n", sense ? "low" : "high");
|
sense ? "low" : "high");
|
||||||
} else
|
} else
|
||||||
printk(KERN_INFO LIRC_DRIVER_NAME ": Manually using active "
|
dev_info(&dev->dev, "Manually using active %s receiver\n",
|
||||||
"%s receiver\n", sense ? "low" : "high");
|
sense ? "low" : "high");
|
||||||
|
|
||||||
dprintk("Interrupt %d, port %04x obtained\n", irq, io);
|
dprintk("Interrupt %d, port %04x obtained\n", irq, io);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1251,8 +1240,7 @@ static int __init lirc_serial_init_module(void)
|
||||||
driver.dev = &lirc_serial_dev->dev;
|
driver.dev = &lirc_serial_dev->dev;
|
||||||
driver.minor = lirc_register_driver(&driver);
|
driver.minor = lirc_register_driver(&driver);
|
||||||
if (driver.minor < 0) {
|
if (driver.minor < 0) {
|
||||||
printk(KERN_ERR LIRC_DRIVER_NAME
|
pr_err("register_chrdev failed!\n");
|
||||||
": register_chrdev failed!\n");
|
|
||||||
lirc_serial_exit();
|
lirc_serial_exit();
|
||||||
return driver.minor;
|
return driver.minor;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue