Skip to content

Commit cd43c22

Browse files
umakrishnmartinkpetersen
authored andcommitted
scsi: cxlflash: Isolate external module dependencies
Depending on the underlying transport, cxlflash has a dependency on either the CXL or OCXL drivers, which are enabled via their Kconfig option. Instead of having a module wide dependency on these config options, it is better to isolate the object modules that are dependent on the CXL and OCXL drivers and adjust the module dependencies accordingly. This commit isolates the object files that are dependent on CXL and/or OCXL. The cxl/ocxl fops used in the core driver are tucked under an ifdef to avoid compilation errors. Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent de5d35a commit cd43c22

File tree

7 files changed

+16
-7
lines changed

7 files changed

+16
-7
lines changed

drivers/scsi/cxlflash/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
config CXLFLASH
66
tristate "Support for IBM CAPI Flash"
7-
depends on PCI && SCSI && CXL && OCXL && EEH
7+
depends on PCI && SCSI && (CXL || OCXL) && EEH
88
select IRQ_POLL
99
default m
1010
help

drivers/scsi/cxlflash/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
obj-$(CONFIG_CXLFLASH) += cxlflash.o
2-
cxlflash-y += main.o superpipe.o lunmgt.o vlun.o cxl_hw.o ocxl_hw.o
2+
cxlflash-y += main.o superpipe.o lunmgt.o vlun.o
3+
cxlflash-$(CONFIG_CXL) += cxl_hw.o
4+
cxlflash-$(CONFIG_OCXL) += ocxl_hw.o

drivers/scsi/cxlflash/lunmgt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@
1212
* 2 of the License, or (at your option) any later version.
1313
*/
1414

15-
#include <misc/cxl.h>
1615
#include <asm/unaligned.h>
1716

17+
#include <linux/interrupt.h>
18+
#include <linux/pci.h>
19+
1820
#include <scsi/scsi_host.h>
1921
#include <uapi/scsi/cxlflash_ioctl.h>
2022

drivers/scsi/cxlflash/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#include <asm/unaligned.h>
2121

22-
#include <misc/cxl.h>
23-
2422
#include <scsi/scsi_cmnd.h>
2523
#include <scsi/scsi_host.h>
2624
#include <uapi/scsi/cxlflash_ioctl.h>

drivers/scsi/cxlflash/main.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,15 @@ cxlflash_assign_ops(struct dev_dependent_vals *ddv)
107107
{
108108
const struct cxlflash_backend_ops *ops = NULL;
109109

110+
#ifdef CONFIG_OCXL
110111
if (ddv->flags & CXLFLASH_OCXL_DEV)
111112
ops = &cxlflash_ocxl_ops;
113+
#endif
114+
115+
#ifdef CONFIG_CXL
112116
if (!(ddv->flags & CXLFLASH_OCXL_DEV))
113117
ops = &cxlflash_cxl_ops;
118+
#endif
114119

115120
return ops;
116121
}

drivers/scsi/cxlflash/superpipe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414

1515
#include <linux/delay.h>
1616
#include <linux/file.h>
17+
#include <linux/interrupt.h>
18+
#include <linux/pci.h>
1719
#include <linux/syscalls.h>
18-
#include <misc/cxl.h>
1920
#include <asm/unaligned.h>
2021

2122
#include <scsi/scsi.h>

drivers/scsi/cxlflash/vlun.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* 2 of the License, or (at your option) any later version.
1313
*/
1414

15+
#include <linux/interrupt.h>
16+
#include <linux/pci.h>
1517
#include <linux/syscalls.h>
16-
#include <misc/cxl.h>
1718
#include <asm/unaligned.h>
1819
#include <asm/bitsperlong.h>
1920

0 commit comments

Comments
 (0)