aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-08-06 05:13:23 -0400
committerTakashi Iwai <tiwai@suse.de>2009-08-10 07:59:12 -0400
commit1905b1bfc0de6f69a61dc03cac0d86a04b3216bd (patch)
tree2accb0cdfa03c279ac610438500d614fb10419eb /include/linux/fs.h
parented680c4ad478d0fee9740f7d029087f181346564 (diff)
chrdev: implement __[un]register_chrdev()
[un]register_chrdev() assume minor range 0-255. This patch adds __ prefixed versions which take @minorbase and @count explicitly. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index a36ffa5a77a4..6c36ab788854 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1998,12 +1998,25 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *);
1998#define CHRDEV_MAJOR_HASH_SIZE 255 1998#define CHRDEV_MAJOR_HASH_SIZE 255
1999extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); 1999extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *);
2000extern int register_chrdev_region(dev_t, unsigned, const char *); 2000extern int register_chrdev_region(dev_t, unsigned, const char *);
2001extern int register_chrdev(unsigned int, const char *, 2001extern int __register_chrdev(unsigned int major, unsigned int baseminor,
2002 const struct file_operations *); 2002 unsigned int count, const char *name,
2003extern void unregister_chrdev(unsigned int, const char *); 2003 const struct file_operations *fops);
2004extern void __unregister_chrdev(unsigned int major, unsigned int baseminor,
2005 unsigned int count, const char *name);
2004extern void unregister_chrdev_region(dev_t, unsigned); 2006extern void unregister_chrdev_region(dev_t, unsigned);
2005extern void chrdev_show(struct seq_file *,off_t); 2007extern void chrdev_show(struct seq_file *,off_t);
2006 2008
2009static inline int register_chrdev(unsigned int major, const char *name,
2010 const struct file_operations *fops)
2011{
2012 return __register_chrdev(major, 0, 256, name, fops);
2013}
2014
2015static inline void unregister_chrdev(unsigned int major, const char *name)
2016{
2017 __unregister_chrdev(major, 0, 256, name);
2018}
2019
2007/* fs/block_dev.c */ 2020/* fs/block_dev.c */
2008#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ 2021#define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */
2009#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ 2022#define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */