diff mbox series

[SRU,Xenial,3/4] scsi: sas: provide stub implementation for scsi_is_sas_rphy

Message ID 5097ad8a8fd1326ed8cb366d865a5e2e9d2d4b72.1505919046.git.joseph.salisbury@canonical.com
State New
Headers show
Series None | expand

Commit Message

Joseph Salisbury Sept. 20, 2017, 7:12 p.m. UTC
From: Johannes Thumshirn <jthumshirn@suse.de>

BugLink: http://bugs.launchpad.net/bugs/1693369

Provide a stub implementation for scsi_is_sas_rphy for kernel
configurations which do not have CONFIG_SCSI_SAS_ATTRS defined.

Reported-by: kbuild test robot <lkp@intel.com>
Suggested-by: James Bottomley <jejb@linux.vnet.ibm.com>
Reviewed-by: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(back ported from commit c1a23f6d64552b4480208aa584ec7e9c13d6d9c3)
Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>
---
 include/scsi/scsi_transport_sas.h | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 140eeee..31ae074 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -10,6 +10,21 @@  struct scsi_transport_template;
 struct sas_rphy;
 struct request;
 
+#if !IS_ENABLED(CONFIG_SCSI_SAS_ATTRS)
+static inline int is_sas_attached(struct scsi_device *sdev)
+{
+	return 0;
+}
+
+static inline int scsi_is_sas_rphy(const struct device *sdev)
+{
+	return 0;
+}
+#else
+extern int is_sas_attached(struct scsi_device *sdev);
+extern int scsi_is_sas_rphy(const struct device *);
+#endif
+
 static inline int sas_protocol_ata(enum sas_protocol proto)
 {
 	return ((proto & SAS_PROTOCOL_SATA) ||
@@ -193,7 +208,6 @@  extern int sas_rphy_add(struct sas_rphy *);
 extern void sas_rphy_remove(struct sas_rphy *);
 extern void sas_rphy_delete(struct sas_rphy *);
 extern void sas_rphy_unlink(struct sas_rphy *);
-extern int scsi_is_sas_rphy(const struct device *);
 
 struct sas_port *sas_port_alloc(struct device *, int);
 struct sas_port *sas_port_alloc_num(struct device *);