From mboxrd@z Thu Jan 1 00:00:00 1970 From: anno79@mailbox.org (anno79 at mailbox.org) Date: Fri, 24 Jun 2016 18:44:16 +0200 (CEST) Subject: no device creation by udev Message-ID: <1608011627.62108.1466786656948@office.mailbox.org> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org I have written the following lines of code to get a char device working. ( lines with # indicate that I have tried versions of this code snippet without them) class_hello = class_create(THIS_MODULE, device_name); # class_hello->devnode = &hello_devnode; retval = alloc_chrdev_region( &dev_file, 0, 1, device_name ); cdev_init( &device, &file_ops ); # device.owner = THIS_MODULE; # kobject_set_name(&device.kobj, device_name); cdev_add( &device, MKDEV(dev_file, 0), 1 ) device = device_create( class_hello, NULL, MKDEV(dev_file, 0), NULL, device_name ); # kobj_device->devt = MKDEV(dev_file, 0); Make it open / close / read / write works fine - but look at that $ ls /sys/class/hello/hello power subsystem uevent The "dev" entry is missing - and udev does not react. Anybody knows what is else needed to make udev react? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20160624/4c9cf3d2/attachment.html