git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
char
/
lp.c
diff --git
a/drivers/char/lp.c
b/drivers/char/lp.c
index
4dee945
..
e572605
100644
(file)
--- a/
drivers/char/lp.c
+++ b/
drivers/char/lp.c
@@
-128,6
+128,7
@@
#include <linux/console.h>
#include <linux/device.h>
#include <linux/wait.h>
#include <linux/console.h>
#include <linux/device.h>
#include <linux/wait.h>
+#include <linux/jiffies.h>
#include <linux/parport.h>
#undef LP_STATS
#include <linux/parport.h>
#undef LP_STATS
@@
-146,7
+147,7
@@
static struct lp_struct lp_table[LP_NO];
static unsigned int lp_count = 0;
static struct lp_struct lp_table[LP_NO];
static unsigned int lp_count = 0;
-static struct class
_simple
*lp_class;
+static struct class *lp_class;
#ifdef CONFIG_LP_CONSOLE
static struct parport *console_registered; // initially NULL
#ifdef CONFIG_LP_CONSOLE
static struct parport *console_registered; // initially NULL
@@
-307,7
+308,7
@@
static ssize_t lp_write(struct file * file, const char __user * buf,
(LP_F(minor) & LP_ABORT));
#ifdef LP_STATS
(LP_F(minor) & LP_ABORT));
#ifdef LP_STATS
- if (
jiffies-lp_table[minor].lastcall > LP_TIME(minor
))
+ if (
time_after(jiffies, lp_table[minor].lastcall + LP_TIME(minor)
))
lp_table[minor].runchars = 0;
lp_table[minor].lastcall = jiffies;
lp_table[minor].runchars = 0;
lp_table[minor].lastcall = jiffies;
@@
-804,7
+805,7
@@
static int lp_register(int nr, struct parport *port)
if (reset)
lp_reset(nr);
if (reset)
lp_reset(nr);
- class_
simple_device_add(lp_class
, MKDEV(LP_MAJOR, nr), NULL,
+ class_
device_create(lp_class, NULL
, MKDEV(LP_MAJOR, nr), NULL,
"lp%d", nr);
devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
"printers/%d", nr);
"lp%d", nr);
devfs_mk_cdev(MKDEV(LP_MAJOR, nr), S_IFCHR | S_IRUGO | S_IWUGO,
"printers/%d", nr);
@@
-907,7
+908,7
@@
static int __init lp_init (void)
}
devfs_mk_dir("printers");
}
devfs_mk_dir("printers");
- lp_class = class_
simple_
create(THIS_MODULE, "printer");
+ lp_class = class_create(THIS_MODULE, "printer");
if (IS_ERR(lp_class)) {
err = PTR_ERR(lp_class);
goto out_devfs;
if (IS_ERR(lp_class)) {
err = PTR_ERR(lp_class);
goto out_devfs;
@@
-930,7
+931,7
@@
static int __init lp_init (void)
return 0;
out_class:
return 0;
out_class:
- class_
simple_
destroy(lp_class);
+ class_destroy(lp_class);
out_devfs:
devfs_remove("printers");
unregister_chrdev(LP_MAJOR, "lp");
out_devfs:
devfs_remove("printers");
unregister_chrdev(LP_MAJOR, "lp");
@@
-981,10
+982,10
@@
static void lp_cleanup_module (void)
continue;
parport_unregister_device(lp_table[offset].dev);
devfs_remove("printers/%d", offset);
continue;
parport_unregister_device(lp_table[offset].dev);
devfs_remove("printers/%d", offset);
- class_
simple_device_remove(
MKDEV(LP_MAJOR, offset));
+ class_
device_destroy(lp_class,
MKDEV(LP_MAJOR, offset));
}
devfs_remove("printers");
}
devfs_remove("printers");
- class_
simple_
destroy(lp_class);
+ class_destroy(lp_class);
}
__setup("lp=", lp_setup);
}
__setup("lp=", lp_setup);