> static int __init my_init(void) { > int err = 0; > if (alloc_chrdev_region(&dev, 0, 1, "my_device") != 0) { > printk("<1>error: alloc_chrdev_region failed!"); > return -1; > } Just calling register_chrdev should be enough for you case. See drivers\char\mem.c for an example. > cdev_init(&my_cdev, &fops); > err = cdev_add(&my_cdev, &dev, 1); You don't need all this code. > then I add this line to the /etc/udev/udev.rules: > KERNEL=="my_device" NAME="my_device" > No need to modify udev.rules unless you want to change the name of the created device file. - Sekhar Nori -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/