linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: UDEV.
Date: Tue, 24 Aug 2010 12:50:46 +0000	[thread overview]
Message-ID: <20100824125046.GA19838@kroah.com> (raw)
In-Reply-To: <E1OlfId-0002cX-00.ge-star-mail-ru@f108.mail.ru>

On Tue, Aug 24, 2010 at 01:27:15PM +0400, Тима wrote:
> > 
> > A: No.
> > Q: Should I include quotations after my reply?
> > 
> > http://daringfireball.net/2007/07/on_top
> > 
> > On Thu, Aug 19, 2010 at 07:07:40PM +0400, ???? wrote:
> > > Thanks. 
> > > My question (I think) is very easy. But I could not find answer in the Internet, and did not get it on forum.
> > > My aim is to make UDEV create device node automatically on loading module.
> > > I tied rule:
> > > KERNEL="math", NAME="math"
> > > meaning my device name (register char dev) is "math" and the node name I want is "math".
> > > But nothing happens.
> > > Is there any possibility to make such rule?
> > > Maybe I do not export some required information to SysFS?
> > > If you need module code I can send it to you with Makefile.
> > 
> > Yes, please post your kernel code.  You need to hook into the driver
> > model to properly be able to have udev pick up your device information.
> > Have you done that?
> > 
> > thanks,
> > 
> > greg k-h
> 
> Yes, here is my code.
> (Sorry for comments in russian. If you need something to understand -
> ask me and I'll translate it.) I want kernel to make, for example,
> /dev/math on loading this module. What should I add to this code or to
> UDEV rules?

You need to tie into a class somehow.

The easiest way to do this is to make your driver a 'misc' device and
call misc_register() to get a minor number and register your
file_operations structure.  That infrastructure will then set up
everything properly so that udev will automatically create your device
node.

If you don't want to do that, then you need to create your own 'struct
class' and register a device with it after you register your chardev.
See the kernel for lots of examples of how to do this.

Hope this helps,

greg k-h

  parent reply	other threads:[~2010-08-24 12:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18  9:51 UDEV Тима
2010-08-18 12:49 ` UDEV Greg KH
2010-08-19 15:27 ` UDEV Greg KH
2010-08-24 12:50 ` Greg KH [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-08-11 18:28 udev Greg KH
2005-08-11 18:29 ` udev Mike
2005-08-11 19:16 ` udev Greg KH
2005-08-11 19:21 ` udev Mike
2005-08-11 19:36 ` udev Kay Sievers
2005-08-12 15:33 ` udev Mike
2005-08-12 18:03 ` udev Greg KH
2009-11-02 11:10 ` udev Oleg Puchinin
2009-11-02 11:50 ` udev Oleg Puchinin
2009-11-02 14:35 ` udev Andrey Borzenkov
2009-11-02 16:57 ` udev Alan Jenkins
2011-03-22 19:48 ` Udev Paulo Eliseu Weber
2011-03-22 19:58 ` Udev Kay Sievers
2004-08-08 22:47 udev Luke Kenneth Casson Leighton
2004-08-09 12:36 ` udev Luke Kenneth Casson Leighton
2004-08-09 12:40 ` udev Marco d'Itri

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=20100824125046.GA19838@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-hotplug@vger.kernel.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).