• Home
  • Raw
  • Download

Lines Matching full:major

14 #include <linux/major.h>
36 unsigned int major; member
44 static inline int major_to_index(unsigned major) in major_to_index() argument
46 return major % CHRDEV_MAJOR_HASH_SIZE; in major_to_index()
57 if (cd->major == offset) in chrdev_show()
58 seq_printf(f, "%3d %s\n", cd->major, cd->name); in chrdev_show()
78 if (cd->major == i) in find_dynamic_major()
89 * Register a single major with a specified minor range.
91 * If major == 0 this functions will dynamically allocate a major and return
94 * If major > 0 this function will attempt to reserve the passed range of
100 __register_chrdev_region(unsigned int major, unsigned int baseminor, in __register_chrdev_region() argument
113 if (major == 0) { in __register_chrdev_region()
120 major = ret; in __register_chrdev_region()
123 if (major >= CHRDEV_MAJOR_MAX) { in __register_chrdev_region()
124 pr_err("CHRDEV \"%s\" major requested (%u) is greater than the maximum (%u)\n", in __register_chrdev_region()
125 name, major, CHRDEV_MAJOR_MAX-1); in __register_chrdev_region()
130 cd->major = major; in __register_chrdev_region()
135 i = major_to_index(major); in __register_chrdev_region()
138 if ((*cp)->major > major || in __register_chrdev_region()
139 ((*cp)->major == major && in __register_chrdev_region()
145 if (*cp && (*cp)->major == major) { in __register_chrdev_region()
181 __unregister_chrdev_region(unsigned major, unsigned baseminor, int minorct) in __unregister_chrdev_region() argument
184 int i = major_to_index(major); in __unregister_chrdev_region()
188 if ((*cp)->major == major && in __unregister_chrdev_region()
203 * the major number.
216 next = MKDEV(MAJOR(n)+1, 0); in register_chrdev_region()
219 cd = __register_chrdev_region(MAJOR(n), MINOR(n), in register_chrdev_region()
228 next = MKDEV(MAJOR(n)+1, 0); in register_chrdev_region()
229 kfree(__unregister_chrdev_region(MAJOR(n), MINOR(n), next - n)); in register_chrdev_region()
241 * Allocates a range of char device numbers. The major number will be
252 *dev = MKDEV(cd->major, cd->baseminor); in alloc_chrdev_region()
258 * @major: major device number or 0 for dynamic allocation
264 * If @major == 0 this functions will dynamically allocate a major and return
267 * If @major > 0 this function will attempt to reserve a device with the given
268 * major number and will return zero on success.
277 int __register_chrdev(unsigned int major, unsigned int baseminor, in __register_chrdev() argument
285 cd = __register_chrdev_region(major, baseminor, count, name); in __register_chrdev()
297 err = cdev_add(cdev, MKDEV(cd->major, baseminor), count); in __register_chrdev()
303 return major ? 0 : cd->major; in __register_chrdev()
307 kfree(__unregister_chrdev_region(cd->major, baseminor, count)); in __register_chrdev()
326 next = MKDEV(MAJOR(n)+1, 0); in unregister_chrdev_region()
329 kfree(__unregister_chrdev_region(MAJOR(n), MINOR(n), next - n)); in unregister_chrdev_region()
335 * @major: major device number
341 * @major, @baseminor and @count. This function undoes what
344 void __unregister_chrdev(unsigned int major, unsigned int baseminor, in __unregister_chrdev() argument
349 cd = __unregister_chrdev_region(major, baseminor, count); in __unregister_chrdev()
667 if (request_module("char-major-%d-%d", MAJOR(dev), MINOR(dev)) > 0) in base_probe()
669 request_module("char-major-%d", MAJOR(dev)); in base_probe()