static DEFINE_MUTEX(lp_mutex);
static struct lp_struct lp_table[LP_NO];
+static int port_num[LP_NO];
static unsigned int lp_count = 0;
static struct class *lp_class;
CONSOLE_LP, port->name);
}
#endif
+ port_num[nr] = port->number;
return 0;
}
init_waitqueue_head(&lp_table[i].dataq);
mutex_init(&lp_table[i].port_mutex);
lp_table[i].timeout = 10 * HZ;
+ port_num[i] = -1;
}
if (register_chrdev(LP_MAJOR, "lp", &lp_fops)) {
for (offset = 0; offset < LP_NO; offset++) {
if (lp_table[offset].dev == NULL)
continue;
+ port_num[offset] = -1;
parport_unregister_device(lp_table[offset].dev);
device_destroy(lp_class, MKDEV(LP_MAJOR, offset));
}