diff options
author | Roland Dreier <roland@purestorage.com> | 2018-10-20 18:45:16 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-24 03:19:20 +0200 |
commit | 6110f37fb33d54781e1fa841922c466c8b9005cd (patch) | |
tree | bb93b3cac5a4effc37911f0097b1a76b4c0a243e /drivers | |
parent | scsi: target: Set response length for REPORT TARGET PORT GROUPS (diff) | |
download | linux-6110f37fb33d54781e1fa841922c466c8b9005cd.tar.xz linux-6110f37fb33d54781e1fa841922c466c8b9005cd.zip |
scsi: target: Don't request modules that aren't even built
If, for example, I don't enable CONFIG_TCM_PSCSI, then every time I load
the target subsystem, I get an annoying
Unable to load target_core_pscsi
kernel log message. Instead let's only request_module() on things if
that code is enabled.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/target/target_core_transport.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4cf33e2cc705..e31e4fc31aa1 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -205,19 +205,19 @@ void transport_subsystem_check_init(void) if (sub_api_initialized) return; - ret = request_module("target_core_iblock"); + ret = IS_ENABLED(CONFIG_TCM_IBLOCK) && request_module("target_core_iblock"); if (ret != 0) pr_err("Unable to load target_core_iblock\n"); - ret = request_module("target_core_file"); + ret = IS_ENABLED(CONFIG_TCM_FILEIO) && request_module("target_core_file"); if (ret != 0) pr_err("Unable to load target_core_file\n"); - ret = request_module("target_core_pscsi"); + ret = IS_ENABLED(CONFIG_TCM_PSCSI) && request_module("target_core_pscsi"); if (ret != 0) pr_err("Unable to load target_core_pscsi\n"); - ret = request_module("target_core_user"); + ret = IS_ENABLED(CONFIG_TCM_USER2) && request_module("target_core_user"); if (ret != 0) pr_err("Unable to load target_core_user\n"); |