diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-01-16 19:39:40 -0500 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-29 17:21:44 -0400 |
commit | cddade083e5ea74cba6f0e4b2fa10c6bbec1336c (patch) | |
tree | 83834a457cfd6b52d895629036f84a1aed36ea2f /litmus/ftdev.c | |
parent | a084c01569bcfe13fd880a0b1e3a9026629a89da (diff) |
Add optional dynamic assignment of tracing devices major nr
Setting FT_TASK_TRACE_MAJOR, LOG_MAJOR, FT_TRACE_MAJOR to 0
allows to have them automatically assigned by the kernel
Diffstat (limited to 'litmus/ftdev.c')
-rw-r--r-- | litmus/ftdev.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/litmus/ftdev.c b/litmus/ftdev.c index 1c1c241a0a69..8b2d74d816a2 100644 --- a/litmus/ftdev.c +++ b/litmus/ftdev.c | |||
@@ -332,8 +332,15 @@ int register_ftdev(struct ftdev* ftdev, const char* name, int major) | |||
332 | dev_t trace_dev; | 332 | dev_t trace_dev; |
333 | int error = 0; | 333 | int error = 0; |
334 | 334 | ||
335 | trace_dev = MKDEV(major, 0); | 335 | if(major) { |
336 | error = register_chrdev_region(trace_dev, ftdev->minor_cnt, name); | 336 | trace_dev = MKDEV(major, 0); |
337 | error = register_chrdev_region(trace_dev, ftdev->minor_cnt, | ||
338 | name); | ||
339 | } else { | ||
340 | error = alloc_chrdev_region(&trace_dev, 0, ftdev->minor_cnt, | ||
341 | name); | ||
342 | major = MAJOR(trace_dev); | ||
343 | } | ||
337 | if (error) | 344 | if (error) |
338 | { | 345 | { |
339 | printk(KERN_WARNING "ftdev(%s): " | 346 | printk(KERN_WARNING "ftdev(%s): " |