Commit bfa61ad0 authored by Lucas Correia Villa Real's avatar Lucas Correia Villa Real Committed by Linus Torvalds

[PATCH] 2.5.31_drivers_char_lp.c

  This is a trivial patch already applied in the -ac tree for the 2.4.19 kernel.
  Patch for lp.c avoid +/- operations with 0 and explicit some debug information
  as KERN_INFO or KERN_ERR.
parent 4b3ceffb
......@@ -335,7 +335,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
do {
/* Write the data. */
written = parport_write (port, kbuf, copy_size);
if (written >= 0) {
if (written > 0) {
copy_size -= written;
count -= written;
buf += written;
......@@ -840,7 +840,7 @@ static void lp_attach (struct parport *port)
port->probe_info[0].class != PARPORT_CLASS_PRINTER)
return;
if (lp_count == LP_NO) {
printk("lp: ignoring parallel port (max. %d)\n",LP_NO);
printk(KERN_INFO "lp: ignoring parallel port (max. %d)\n",LP_NO);
return;
}
if (!lp_register(lp_count, port))
......@@ -904,14 +904,14 @@ int __init lp_init (void)
}
if (register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
printk ("lp: unable to get major %d\n", LP_MAJOR);
printk (KERN_ERR "lp: unable to get major %d\n", LP_MAJOR);
return -EIO;
}
devfs_handle = devfs_mk_dir (NULL, "printers", NULL);
if (parport_register_driver (&lp_driver)) {
printk ("lp: unable to register with parport\n");
printk (KERN_ERR "lp: unable to register with parport\n");
return -EIO;
}
......
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