Merge of the trunk's r2354:

Let's make check for SCST_PR_DIR not global, but per created device, because it's more reliable and flexible.



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@2355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-10-06 12:28:42 +00:00
parent 0b072d852c
commit 557622b30a
3 changed files with 7 additions and 12 deletions

View File

@@ -2335,10 +2335,6 @@ static int __init init_scst(void)
res = scst_proc_init_module();
if (res != 0)
goto out_thread_free;
#else
res = scst_pr_check_pr_path();
if (res != 0)
goto out_thread_free;
#endif
PRINT_INFO("SCST version %s loaded successfully (max mem for "

View File

@@ -1119,7 +1119,7 @@ write_error_close:
goto out_set_fs;
}
int scst_pr_check_pr_path(void)
static int scst_pr_check_pr_path(void)
{
int res;
struct nameidata nd;
@@ -1180,9 +1180,12 @@ int scst_pr_init_dev(struct scst_device *dev)
dev->virt_name);
#ifndef CONFIG_SCST_PROC
res = scst_pr_load_device_file(dev);
if (res == -ENOENT)
res = 0;
res = scst_pr_check_pr_path();
if (res == 0) {
res = scst_pr_load_device_file(dev);
if (res == -ENOENT)
res = 0;
}
#endif
if (res != 0)

View File

@@ -60,10 +60,6 @@ static inline bool scst_pr_type_valid(uint8_t type)
}
}
#ifndef CONFIG_SCST_PROC
int scst_pr_check_pr_path(void);
#endif
static inline bool scst_pr_read_lock(struct scst_device *dev)
{
bool unlock = false;