From 557622b30a38a225c2a069627de47cc02f0271cc Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 6 Oct 2010 12:28:42 +0000 Subject: [PATCH] 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 --- scst/src/scst_main.c | 4 ---- scst/src/scst_pres.c | 11 +++++++---- scst/src/scst_pres.h | 4 ---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 7ae3c7c44..113d75e80 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -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 " diff --git a/scst/src/scst_pres.c b/scst/src/scst_pres.c index 7fa513d87..de67e3db3 100644 --- a/scst/src/scst_pres.c +++ b/scst/src/scst_pres.c @@ -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) diff --git a/scst/src/scst_pres.h b/scst/src/scst_pres.h index ae9e28f33..534a7f929 100644 --- a/scst/src/scst_pres.h +++ b/scst/src/scst_pres.h @@ -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;