summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/block_dev.c4
-rw-r--r--fs/devfs/base.c50
-rw-r--r--fs/devices.c4
3 files changed, 8 insertions, 50 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 4b65320f33c0..62c973eeb278 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -453,7 +453,7 @@ struct block_device_operations * get_blkfops(unsigned int major)
int register_blkdev(unsigned int major, const char * name, struct block_device_operations *bdops)
{
- if (devfs_should_register_blkdev())
+ if (devfs_only())
return 0;
if (major == 0) {
for (major = MAX_BLKDEV-1; major > 0; major--) {
@@ -476,7 +476,7 @@ int register_blkdev(unsigned int major, const char * name, struct block_device_o
int unregister_blkdev(unsigned int major, const char * name)
{
- if (devfs_should_unregister_blkdev())
+ if (devfs_only())
return 0;
if (major >= MAX_BLKDEV)
return -EINVAL;
diff --git a/fs/devfs/base.c b/fs/devfs/base.c
index 90d8bf08d72e..7731d36ef133 100644
--- a/fs/devfs/base.c
+++ b/fs/devfs/base.c
@@ -2228,61 +2228,19 @@ const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen)
/**
- * devfs_should_register_chrdev - should we register a conventional character driver.
+ * devfs_only - returns if "devfs=only" is a boot option
*
- * If "devfs=only" this function will return -1, otherwise 0 is returned.
+ * If "devfs=only" this function will return 1, otherwise 0 is returned.
*/
-int devfs_should_register_chrdev (void)
+int devfs_only (void)
{
if (boot_options & OPTION_ONLY)
- return -1;
+ return 1;
return 0;
}
/**
- * devfs_should_register_blkdev - should we register a conventional block driver.
- *
- * If the "devfs=only" option was provided at boot time, this function will
- * return -1, otherwise 0 is returned.
- */
-
-int devfs_should_register_blkdev (void)
-{
- if (boot_options & OPTION_ONLY)
- return -1;
- return 0;
-}
-
-
-/**
- * devfs_should_unregister_chrdev - should we unregister a conventional character driver.
- *
- * If "devfs=only" this function will return -1, otherwise 0 is returned
- */
-int devfs_should_unregister_chrdev (void)
-{
- if (boot_options & OPTION_ONLY)
- return -1;
- return 0;
-}
-
-
-/**
- * devfs_should_unregister_blkdev - should we unregister a conventional block driver.
- *
- * If the "devfs=only" option was provided at boot time, this function will
- * return -1, otherwise 0 is returned.
- */
-
-int devfs_should_unregister_blkdev (void)
-{
- if (boot_options & OPTION_ONLY)
- return -1;
- return 0;
-}
-
-/**
* devfs_setup - Process kernel boot options.
* @str: The boot options after the "devfs=".
*/
diff --git a/fs/devices.c b/fs/devices.c
index eb242107eacf..69874923b79f 100644
--- a/fs/devices.c
+++ b/fs/devices.c
@@ -98,7 +98,7 @@ static struct file_operations * get_chrfops(unsigned int major, unsigned int min
int register_chrdev(unsigned int major, const char * name, struct file_operations *fops)
{
- if (devfs_should_register_chrdev())
+ if (devfs_only())
return 0;
if (major == 0) {
write_lock(&chrdevs_lock);
@@ -128,7 +128,7 @@ int register_chrdev(unsigned int major, const char * name, struct file_operation
int unregister_chrdev(unsigned int major, const char * name)
{
- if (devfs_should_register_chrdev())
+ if (devfs_only())
return 0;
if (major >= MAX_CHRDEV)
return -EINVAL;