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, ...@@ -335,7 +335,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
do { do {
/* Write the data. */ /* Write the data. */
written = parport_write (port, kbuf, copy_size); written = parport_write (port, kbuf, copy_size);
if (written >= 0) { if (written > 0) {
copy_size -= written; copy_size -= written;
count -= written; count -= written;
buf += written; buf += written;
...@@ -840,7 +840,7 @@ static void lp_attach (struct parport *port) ...@@ -840,7 +840,7 @@ static void lp_attach (struct parport *port)
port->probe_info[0].class != PARPORT_CLASS_PRINTER) port->probe_info[0].class != PARPORT_CLASS_PRINTER)
return; return;
if (lp_count == LP_NO) { 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; return;
} }
if (!lp_register(lp_count, port)) if (!lp_register(lp_count, port))
...@@ -904,14 +904,14 @@ int __init lp_init (void) ...@@ -904,14 +904,14 @@ int __init lp_init (void)
} }
if (register_chrdev (LP_MAJOR, "lp", &lp_fops)) { 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; return -EIO;
} }
devfs_handle = devfs_mk_dir (NULL, "printers", NULL); devfs_handle = devfs_mk_dir (NULL, "printers", NULL);
if (parport_register_driver (&lp_driver)) { 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; 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