diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 72a15e421..618a5f83f 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -2344,10 +2344,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 13c67cef6..e65057e1d 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;