static inline void pp_enable_irq(struct pp_struct *pp)
{
struct parport *port = pp->pdev->port;
+
port->ops->enable_irq(port);
}
/* Deferred device registration. */
if (!pp->pdev) {
int err = register_device(minor, pp);
+
if (err) {
return err;
}
case PPSETMODE:
{
int mode;
+
if (copy_from_user(&mode, argp, sizeof(mode)))
return -EFAULT;
/* FIXME: validate mode */
case PPSETPHASE:
{
int phase;
+
if (copy_from_user(&phase, argp, sizeof(phase))) {
return -EFAULT;
}
static long pp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
long ret;
+
mutex_lock(&pp_do_mutex);
ret = pp_do_ioctl(file, cmd, arg);
mutex_unlock(&pp_do_mutex);
if (pp->pdev) {
const char *name = pp->pdev->name;
+
parport_unregister_device(pp->pdev);
kfree(name);
pp->pdev = NULL;