- goto out_alloc2;
- /* allocate any major number with only one minor */
- r = alloc_chrdev_region(&dev, 0, DEVICE_NUMBER, "helloc");
- if (r)
- goto out_region;
- r = -ENOMEM;
- /* print the major number allocated so we can create our device node */
- printk(KERN_INFO "Allocated major number %d\n", MAJOR(dev));
- /* allocate the character device struct */
- cdev = cdev_alloc();
- if (!cdev)