kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: anno79@mailbox.org (anno79 at mailbox.org)
To: kernelnewbies@lists.kernelnewbies.org
Subject: no device creation by udev
Date: Fri, 24 Jun 2016 18:44:16 +0200 (CEST)	[thread overview]
Message-ID: <1608011627.62108.1466786656948@office.mailbox.org> (raw)

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 

             reply	other threads:[~2016-06-24 16:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 16:44 anno79 at mailbox.org [this message]
2016-07-01 14:38 ` no device creation by udev Victor Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1608011627.62108.1466786656948@office.mailbox.org \
    --to=anno79@mailbox.org \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).