[SCSI] add wrapper to access and set scsi_bus_type in struct acpi_bus_type
authorHolger Macht <holger@homac.de>
Mon, 25 Jun 2012 08:13:02 +0000 (16:13 +0800)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 29 Jun 2012 15:38:09 +0000 (11:38 -0400)
For being able to bind ata devices against acpi devices, scsi_bus_type
needs to be set as bus in struct acpi_bus_type. So add wrapper to
scsi_lib to accomplish that.

Signed-off-by: Holger Macht <holger@homac.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/scsi/scsi_lib.c
include/scsi/scsi.h

index 6dfb9785d34581eb06395ef1d4b372b243de5d87..08f1e297c73530e801e871392178ec3110d4ac9f 100644 (file)
@@ -68,6 +68,23 @@ static struct scsi_host_sg_pool scsi_sg_pools[] = {
 
 struct kmem_cache *scsi_sdb_cache;
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi_bus.h>
+
+int scsi_register_acpi_bus_type(struct acpi_bus_type *bus)
+{
+        bus->bus = &scsi_bus_type;
+        return register_acpi_bus_type(bus);
+}
+EXPORT_SYMBOL_GPL(scsi_register_acpi_bus_type);
+
+void scsi_unregister_acpi_bus_type(struct acpi_bus_type *bus)
+{
+       unregister_acpi_bus_type(bus);
+}
+EXPORT_SYMBOL_GPL(scsi_unregister_acpi_bus_type);
+#endif
+
 /*
  * When to reinvoke queueing after a resource shortage. It's 3 msecs to
  * not change behaviour from the previous unplug mechanism, experimentation
index f34a5a87af388eb3ced856b0749c77fd5dd2fbb3..4527b3a13321bac6cd843b3c400ba997c5a03d5e 100644 (file)
@@ -214,6 +214,16 @@ scsi_command_size(const unsigned char *cmnd)
                scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]);
 }
 
+#ifdef CONFIG_ACPI
+struct acpi_bus_type;
+
+extern int
+scsi_register_acpi_bus_type(struct acpi_bus_type *bus);
+
+extern void
+scsi_unregister_acpi_bus_type(struct acpi_bus_type *bus);
+#endif
+
 /*
  *  SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
  *  T10/1561-D Revision 4 Draft dated 7th November 2002.