Separate block devices from non-block ones

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@141 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2007-07-05 14:20:17 +00:00
parent 3ab4521950
commit 51e3149648
+8 -2
View File
@@ -2489,7 +2489,10 @@ static int dev_user_register_dev(struct file *file,
goto out;
}
if (dev_desc->type != TYPE_TAPE) {
switch(dev_desc->type) {
case TYPE_DISK:
case TYPE_ROM:
case TYPE_MOD:
if (dev_desc->block_size == 0) {
PRINT_ERROR_PR("Wrong block size %d", dev_desc->block_size);
res = -EINVAL;
@@ -2500,8 +2503,11 @@ static int dev_user_register_dev(struct file *file,
res = -EINVAL;
goto out;
}
} else
break;
default:
block = dev_desc->block_size;
break;
}
if (!try_module_get(THIS_MODULE)) {
PRINT_ERROR_PR("%s", "Fail to get module");