patch-2.3.43 linux/drivers/char/ppdev.c
Next file: linux/drivers/char/qpmouse.c
Previous file: linux/drivers/char/pcwd.c
Back to the patch index
Back to the overall index
- Lines: 56
- Date:
Wed Feb 9 11:42:35 2000
- Orig file:
v2.3.42/linux/drivers/char/ppdev.c
- Orig date:
Fri Jan 7 19:13:21 2000
diff -u --recursive --new-file v2.3.42/linux/drivers/char/ppdev.c linux/drivers/char/ppdev.c
@@ -4,7 +4,7 @@
* This is the code behind /dev/parport* -- it allows a user-space
* application to use the parport subsystem.
*
- * Copyright (C) 1998-9 Tim Waugh <tim@cyberelk.demon.co.uk>
+ * Copyright (C) 1998-2000 Tim Waugh <tim@cyberelk.demon.co.uk>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -506,9 +506,13 @@
if (minor >= PARPORT_MAX)
return -ENXIO;
+ MOD_INC_USE_COUNT;
+
pp = kmalloc (sizeof (struct pp_struct), GFP_KERNEL);
- if (!pp)
+ if (!pp) {
+ MOD_DEC_USE_COUNT;
return -ENOMEM;
+ }
pp->state.mode = IEEE1284_MODE_COMPAT;
pp->state.phase = init_phase (pp->state.mode);
@@ -524,7 +528,6 @@
pp->pdev = NULL;
file->private_data = pp;
- MOD_INC_USE_COUNT;
return 0;
}
@@ -567,16 +570,13 @@
}
static struct file_operations pp_fops = {
- pp_lseek,
- pp_read,
- pp_write,
- NULL, /* pp_readdir */
- pp_poll,
- pp_ioctl,
- NULL, /* pp_mmap */
- pp_open,
- NULL, /* pp_flush */
- pp_release
+ llseek: pp_lseek,
+ read: pp_read,
+ write: pp_write,
+ poll: pp_poll,
+ ioctl: pp_ioctl,
+ open: pp_open,
+ release: pp_release,
};
static int __init ppdev_init (void)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)