aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/ftdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/ftdev.c')
-rw-r--r--litmus/ftdev.c11
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): "