summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@digeo.com>2003-03-22 07:34:28 -0800
committerDavid S. Miller <davem@kernel.bkbits.net>2003-03-22 07:34:28 -0800
commit826d245fea084151be45c4b07017666e2a98f9e0 (patch)
tree6da7aa1eadb83836e3d5134f54eb8e482d294cf6 /include/linux
parentc2e562b9bc90940c4c17b4126899ceb418b78b0c (diff)
[PATCH] dev_t [2/3] - remove MAX_CHRDEV
Patch from Andries.Brouwer@cwi.nl The actual patch for today is this part. I already quoted most of this on the list earlier this week. In order not to have to change all drivers, I did +int register_chrdev(unsigned int major, const char *name, + struct file_operations *fops) +{ + return register_chrdev_region(major, 0, 256, name, fops); +} so that the old register_chrdev registers a single major and 256 minors. Later this can be changed (but see my letter to Al last week). The only driver that is tricky is the tty driver. Here some major cleanup happened - all tty specific stuff disappeared from char_dev.c, and tty uses the actual register_chrdev_region() call. There is a race in register_chrdev_region() that I did not worry about: when two dynamic majors 0 are registered simultaneously, one of them will be first and the other one gets -EBUSY. If this is a problem, the code there will have to be uglified a little. I didn't do that because it disappears again in a subsequent patch.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/fs.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 8a436118c17a..2b565674e470 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1055,7 +1055,10 @@ extern void bd_release(struct block_device *);
extern void blk_run_queues(void);
/* fs/char_dev.c */
-extern int register_chrdev(unsigned int, const char *, struct file_operations *);
+extern int register_chrdev_region(unsigned int, unsigned int, int,
+ const char *, struct file_operations *);
+extern int register_chrdev(unsigned int, const char *,
+ struct file_operations *);
extern int unregister_chrdev(unsigned int, const char *);
extern int chrdev_open(struct inode *, struct file *);