summaryrefslogtreecommitdiff
path: root/drivers/scsi/esas2r
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2022-10-15 03:24:12 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-10-18 06:17:09 +0300
commit77916da7e4a0975bd2b93e5214295e3318886cdb (patch)
treea037c70e36c10d4d13aa74b55d2c6fe9b00c1d1d /drivers/scsi/esas2r
parentb6da92356cd6106dd9e7e8e168e3b7df4fe37d5d (diff)
downloadlinux-77916da7e4a0975bd2b93e5214295e3318886cdb.tar.xz
scsi: esas2r: Introduce scsi_template_proc_dir()
Prepare for removing the 'proc_dir' and 'present' members from the SCSI host template. This commit does not change any functionality. Reviewed-by: John Garry <john.garry@huawei.com> Cc: Bradley Grove <linuxdrivers@attotech.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Hannes Reinecke <hare@suse.de> Cc: Mike Christie <michael.christie@oracle.com> Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20221015002418.30955-3-bvanassche@acm.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/esas2r')
-rw-r--r--drivers/scsi/esas2r/esas2r_main.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 27f6e7ccded8..d7a2c49ff5ee 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -635,10 +635,13 @@ static void __exit esas2r_exit(void)
esas2r_log(ESAS2R_LOG_INFO, "%s called", __func__);
if (esas2r_proc_major > 0) {
+ struct proc_dir_entry *proc_dir;
+
esas2r_log(ESAS2R_LOG_INFO, "unregister proc");
- remove_proc_entry(ATTONODE_NAME,
- esas2r_proc_host->hostt->proc_dir);
+ proc_dir = scsi_template_proc_dir(esas2r_proc_host->hostt);
+ if (proc_dir)
+ remove_proc_entry(ATTONODE_NAME, proc_dir);
unregister_chrdev(esas2r_proc_major, ESAS2R_DRVR_NAME);
esas2r_proc_major = 0;
@@ -728,11 +731,13 @@ const char *esas2r_info(struct Scsi_Host *sh)
esas2r_proc_major);
if (esas2r_proc_major > 0) {
- struct proc_dir_entry *pde;
+ struct proc_dir_entry *proc_dir;
+ struct proc_dir_entry *pde = NULL;
- pde = proc_create(ATTONODE_NAME, 0,
- sh->hostt->proc_dir,
- &esas2r_proc_ops);
+ proc_dir = scsi_template_proc_dir(sh->hostt);
+ if (proc_dir)
+ pde = proc_create(ATTONODE_NAME, 0, proc_dir,
+ &esas2r_proc_ops);
if (!pde) {
esas2r_log_dev(ESAS2R_LOG_WARN,