kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: vm.rod25@gmail.com (Victor Rodriguez)
To: kernelnewbies@lists.kernelnewbies.org
Subject: no device creation by udev
Date: Fri, 1 Jul 2016 09:38:54 -0500	[thread overview]
Message-ID: <CAK5mtexT-vaGEH72c5H8hbDdeAOC85u2Wj7LZkOboajntAdO8w@mail.gmail.com> (raw)
In-Reply-To: <1608011627.62108.1466786656948@office.mailbox.org>

On Fri, Jun 24, 2016 at 11:44 AM,  <anno79@mailbox.org> wrote:
> 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?
>

http://www.linuxdevcenter.com/pub/a/linux/2007/07/05/devhelloworld-a-simple-introduction-to-device-drivers-under-linux.html?page=3

Did you register ?

This simple tutorial works fine for me , what kernel version are you ussing ?

Regards

Victor Rodriguez


> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

      reply	other threads:[~2016-07-01 14:38 UTC|newest]

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

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=CAK5mtexT-vaGEH72c5H8hbDdeAOC85u2Wj7LZkOboajntAdO8w@mail.gmail.com \
    --to=vm.rod25@gmail.com \
    --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).