Re: platform device , uevent file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 09, 2009 at 06:43:51PM +0200, Daniel Baluta wrote:
> On Mon, Feb 9, 2009 at 12:20 AM, Greg KH <greg@xxxxxxxxx> wrote:
> > On Sun, Feb 08, 2009 at 07:47:05PM +0200, Daniel Baluta wrote:
> >> Hello,
> >>
> >> I don't really understand how kernel generates events when working
> >> with platform devices and drivers ( [1] ).
> >> I have registered my driver with platform_driver_register and my
> >> device with platform_device_register_simple.
> >>
> >> I want to dynamically create the node in /dev , and for that i need
> >> the kernel to send events like ( MAJOR=x, MINOR=y)
> >> that will be interpreted by the udev daemon acording to rules from
> >> /etc/udev/rules.d.
> >
> > Platform devices can't do this, you need to use a "real" struct device,
> > or register with a class that handles major/minor allocation for you
> > (input, block, etc.)
> >
> > hope this helps,
> >
> > greg k-h
> >
> 
> thanks for your answer.
> 
> I'm writing a driver for a character device [hex display] .
> 
> Registering with an existing class its pretty hard since it doesn't
> fit well in none of the existing classes.

There are other drivers in the kernel that already do something like
this, are you sure there isn't an existing class for you already?

> One good option would be misc class but this enforces the usage of major 10.

What's wrong with that?  It's a dynamic minor number that will "just
work" for your device.

> So , the only solution remaining is using a "real" struct device. I'm
> already using a struct cdev , and it is not very clear for me the
> link between struct cdev and struct device.

There is no link whatsoever.  Yeah, it's confusing at times, sorry, the
cdev interface needs a major overhaul...

thanks,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux