static int __init bpp_init(void) { int rc; unsigned idx; rc = collectLptPorts(); if (rc == 0) return -ENODEV; rc = register_chrdev(BPP_MAJOR, dev_name, &bpp_fops); if (rc < 0) return rc; for (idx = 0; idx < BPP_NO; idx++) { instances[idx].opened = 0; probeLptPort(idx); } devfs_mk_dir("bpp"); for (idx = 0; idx < BPP_NO; idx++) { devfs_mk_cdev(MKDEV(BPP_MAJOR, idx), S_IFCHR | S_IRUSR | S_IWUSR, "bpp/%d", idx); } return 0; }
static int __init bpp_init(void) { int rc; unsigned idx; rc = collectLptPorts(); if (rc == 0) return -ENODEV; rc = register_chrdev(BPP_MAJOR, bpp_dev_name, &bpp_fops); if (rc < 0) return rc; for (idx = 0; idx < BPP_NO; idx++) { instances[idx].opened = 0; probeLptPort(idx); } return 0; }