Re: How to get /dev entry created automaticly for dynamic major number?

2007-01-25 Thread Greg KH
On Thu, Jan 25, 2007 at 03:11:15PM +0200, Markku Savela wrote: > Solution found! > > > On Thu, Jan 25, 2007 at 09:35:07AM +0200, Markku Savela wrote: > > > If want to write a loadable module which "implements" a char device > > > ("virtual", no real device present). How do I get the correct > > >

Re: How to get /dev entry created automaticly for dynamic major number?

2007-01-25 Thread Jiri Kosina
On Thu, 25 Jan 2007, Markku Savela wrote: > Thanks! The solution seems to work. The final *obstacle* was, that > class_* symbols were not available until I added the > LICENSE("GPL"). Here is the resulting template, maybe useful for > someone, and just for verification, that I got it right. > stat

Re: How to get /dev entry created automaticly for dynamic major number?

2007-01-25 Thread Markku Savela
Oops! The error exits are not right in foo_init (need to release anything succesfully created, if later operations fail). Probably need to make the current foo_exit into foo_cleanup and call it in real foo_exit and in any errors at foo_init. But, again thanks for the help. I consider the "case cl

Re: How to get /dev entry created automaticly for dynamic major number?

2007-01-25 Thread Markku Savela
Solution found! > On Thu, Jan 25, 2007 at 09:35:07AM +0200, Markku Savela wrote: > > If want to write a loadable module which "implements" a char device > > ("virtual", no real device present). How do I get the correct > > "/dev/foo" to appear automaticly? > From: Greg KH <[EMAIL PROTECTED]> > I

Re: How to get /dev entry created automaticly for dynamic major number?

2007-01-25 Thread Greg KH
On Thu, Jan 25, 2007 at 09:35:07AM +0200, Markku Savela wrote: > > If want to write a loadable module which "implements" a char device > ("virtual", no real device present). How do I get the correct > "/dev/foo" to appear automaticly? What is the current recommended > solution (kernel 2.6.17 in U

How to get /dev entry created automaticly for dynamic major number?

2007-01-24 Thread Markku Savela
If want to write a loadable module which "implements" a char device ("virtual", no real device present). How do I get the correct "/dev/foo" to appear automaticly? What is the current recommended solution (kernel 2.6.17 in Ubuntu and later). static int major; static int __init foo_init(void)