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

Jiri Kosina
2007-01-25T13:37:22Z

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.
> static struct class_device *foo_device;
[...]
> foo_device = class_device_create(foo_class, NULL, MKDEV(foo_major, 0), NULL, "foo0");
[...]

You should probably rather move away from struct class_device and
class_device_create() and use struct device and device_create() instead
(all the drivers using class_device are currently being converted this
way, so that class_device could go away), so that your driver is using the
new kernel driver core API.

The conversion should be really very simple.

--
Jiri Kosina