From 51e3149648886cd51722288769433ecdd6127cc9 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 5 Jul 2007 14:20:17 +0000 Subject: [PATCH] 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 --- scst/src/dev_handlers/scst_user.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 57315ae31..7e6a3a9aa 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -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");