浏览代码

[SCSI] fix transport class corner case after rework

If your transport class sets the ATTRIBUTE_CONTAINER_NO_CLASSDEVS flag,
then its configure method never gets called.  This patch fixes that so
that the configure method is called with a NULL classdev.

Also remove a spurious inverted comma in the transport_class comments.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
James Bottomley 20 年之前
父节点
当前提交
ebd8bb7647
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 5 0
      drivers/base/attribute_container.c
  2. 1 1
      drivers/base/transport_class.c

+ 5 - 0
drivers/base/attribute_container.c

@@ -237,6 +237,11 @@ attribute_container_device_trigger(struct device *dev,
 		if (!cont->match(cont, dev))
 		if (!cont->match(cont, dev))
 			continue;
 			continue;
 
 
+		if (attribute_container_no_classdevs(cont)) {
+			fn(cont, dev, NULL);
+			continue;
+		}
+
 		spin_lock(&cont->containers_lock);
 		spin_lock(&cont->containers_lock);
 		list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
 		list_for_each_entry_safe(ic, tmp, &cont->containers, node) {
 			if (dev == ic->classdev.dev)
 			if (dev == ic->classdev.dev)

+ 1 - 1
drivers/base/transport_class.c

@@ -7,7 +7,7 @@
  * This file is licensed under GPLv2
  * This file is licensed under GPLv2
  *
  *
  * The basic idea here is to allow any "device controller" (which
  * The basic idea here is to allow any "device controller" (which
- * would most often be a Host Bus Adapter" to use the services of one
+ * would most often be a Host Bus Adapter to use the services of one
  * or more tranport classes for performing transport specific
  * or more tranport classes for performing transport specific
  * services.  Transport specific services are things that the generic
  * services.  Transport specific services are things that the generic
  * command layer doesn't want to know about (speed settings, line
  * command layer doesn't want to know about (speed settings, line