Commit cd43c221 authored by Uma Krishnan's avatar Uma Krishnan Committed by Martin K. Petersen

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: default avatarUma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: default avatarMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent de5d35af
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
config CXLFLASH config CXLFLASH
tristate "Support for IBM CAPI Flash" tristate "Support for IBM CAPI Flash"
depends on PCI && SCSI && CXL && OCXL && EEH depends on PCI && SCSI && (CXL || OCXL) && EEH
select IRQ_POLL select IRQ_POLL
default m default m
help help
......
obj-$(CONFIG_CXLFLASH) += cxlflash.o obj-$(CONFIG_CXLFLASH) += cxlflash.o
cxlflash-y += main.o superpipe.o lunmgt.o vlun.o cxl_hw.o ocxl_hw.o cxlflash-y += main.o superpipe.o lunmgt.o vlun.o
cxlflash-$(CONFIG_CXL) += cxl_hw.o
cxlflash-$(CONFIG_OCXL) += ocxl_hw.o
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <misc/cxl.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <uapi/scsi/cxlflash_ioctl.h> #include <uapi/scsi/cxlflash_ioctl.h>
......
...@@ -19,8 +19,6 @@ ...@@ -19,8 +19,6 @@
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <misc/cxl.h>
#include <scsi/scsi_cmnd.h> #include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <uapi/scsi/cxlflash_ioctl.h> #include <uapi/scsi/cxlflash_ioctl.h>
......
...@@ -107,10 +107,15 @@ cxlflash_assign_ops(struct dev_dependent_vals *ddv) ...@@ -107,10 +107,15 @@ cxlflash_assign_ops(struct dev_dependent_vals *ddv)
{ {
const struct cxlflash_backend_ops *ops = NULL; const struct cxlflash_backend_ops *ops = NULL;
#ifdef CONFIG_OCXL
if (ddv->flags & CXLFLASH_OCXL_DEV) if (ddv->flags & CXLFLASH_OCXL_DEV)
ops = &cxlflash_ocxl_ops; ops = &cxlflash_ocxl_ops;
#endif
#ifdef CONFIG_CXL
if (!(ddv->flags & CXLFLASH_OCXL_DEV)) if (!(ddv->flags & CXLFLASH_OCXL_DEV))
ops = &cxlflash_cxl_ops; ops = &cxlflash_cxl_ops;
#endif
return ops; return ops;
} }
......
...@@ -14,8 +14,9 @@ ...@@ -14,8 +14,9 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/file.h> #include <linux/file.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <misc/cxl.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
......
...@@ -12,8 +12,9 @@ ...@@ -12,8 +12,9 @@
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <misc/cxl.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <asm/bitsperlong.h> #include <asm/bitsperlong.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment