]> git.baikalelectronics.ru Git - kernel.git/commitdiff
scsi: cxlflash: Isolate external module dependencies
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>
Fri, 11 May 2018 19:06:19 +0000 (14:06 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 18 May 2018 15:22:10 +0000 (11:22 -0400)
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>
drivers/scsi/cxlflash/Kconfig
drivers/scsi/cxlflash/Makefile
drivers/scsi/cxlflash/lunmgt.c
drivers/scsi/cxlflash/main.c
drivers/scsi/cxlflash/main.h
drivers/scsi/cxlflash/superpipe.c
drivers/scsi/cxlflash/vlun.c

index e2a3a1ba26fad12eb9c90bd090a2f5411496335f..f1b17e3efb3f68a2d56c0b88487bc9f605e5777b 100644 (file)
@@ -4,7 +4,7 @@
 
 config CXLFLASH
        tristate "Support for IBM CAPI Flash"
-       depends on PCI && SCSI && CXL && OCXL && EEH
+       depends on PCI && SCSI && (CXL || OCXL) && EEH
        select IRQ_POLL
        default m
        help
index 5124c68f8d88078de612c347f07223e515f1a145..283377d8f6fb98c3c035863f845e954c5eda6822 100644 (file)
@@ -1,2 +1,4 @@
 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
index 4d232e271af60edad6316f15e8cc1689b2e807ed..edea1255fdab12f360d238003d627f730372d7ed 100644 (file)
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <misc/cxl.h>
 #include <asm/unaligned.h>
 
+#include <linux/interrupt.h>
+#include <linux/pci.h>
+
 #include <scsi/scsi_host.h>
 #include <uapi/scsi/cxlflash_ioctl.h>
 
index cd7dcc578dfba9f9b2bf4b313291f14f3a33b5b9..6637116529aa3de7077e1d12bcb1f6ebe5509969 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <asm/unaligned.h>
 
-#include <misc/cxl.h>
-
 #include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_host.h>
 #include <uapi/scsi/cxlflash_ioctl.h>
index ed4908e5dffb1a3ce33651627daf118a33f0761f..2a3977823812cce8889e6577f65d3f862b626918 100644 (file)
@@ -107,10 +107,15 @@ cxlflash_assign_ops(struct dev_dependent_vals *ddv)
 {
        const struct cxlflash_backend_ops *ops = NULL;
 
+#ifdef CONFIG_OCXL
        if (ddv->flags & CXLFLASH_OCXL_DEV)
                ops = &cxlflash_ocxl_ops;
+#endif
+
+#ifdef CONFIG_CXL
        if (!(ddv->flags & CXLFLASH_OCXL_DEV))
                ops = &cxlflash_cxl_ops;
+#endif
 
        return ops;
 }
index 5ba6e625666d17f9ff5f395aa26ef072e17fb839..e489d89cbb45ddfbf8fa107545d314e9a598ff56 100644 (file)
@@ -14,8 +14,9 @@
 
 #include <linux/delay.h>
 #include <linux/file.h>
+#include <linux/interrupt.h>
+#include <linux/pci.h>
 #include <linux/syscalls.h>
-#include <misc/cxl.h>
 #include <asm/unaligned.h>
 
 #include <scsi/scsi.h>
index 5deef57a7834e3e2c7b06f5fd00008428982734a..66e445a17d6c2ad4dfa977ce1f639e9c4d72118a 100644 (file)
@@ -12,8 +12,9 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#include <linux/interrupt.h>
+#include <linux/pci.h>
 #include <linux/syscalls.h>
-#include <misc/cxl.h>
 #include <asm/unaligned.h>
 #include <asm/bitsperlong.h>