lkml.org 
[lkml]   [2019]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] chardev: showing minor range for chardev in the output of /proc/devices
Date
Currently chardev allows to share major, showing
major with minor range for chardev will be more
helpful.

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
---
fs/char_dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/char_dev.c b/fs/char_dev.c
index b25b1da097d5..6f00acdeb308 100644
--- a/fs/char_dev.c
+++ b/fs/char_dev.c
@@ -55,7 +55,9 @@ void chrdev_show(struct seq_file *f, off_t offset)
mutex_lock(&chrdevs_lock);
for (cd = chrdevs[major_to_index(offset)]; cd; cd = cd->next) {
if (cd->major == offset)
- seq_printf(f, "%3d %s\n", cd->major, cd->name);
+ seq_printf(f, "%3d %s (%u-%u)\n", cd->major, cd->name,
+ cd->baseminor,
+ cd->baseminor + cd->minorct - 1);
}
mutex_unlock(&chrdevs_lock);
}
--
2.20.1
\
 
 \ /
  Last update: 2019-02-12 09:48    [W:0.050 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site