Commit df4edad1 authored by Linus Torvalds's avatar Linus Torvalds

[SCSI] Revert "final klist fixes"

Revert commit 2b7d6a8c.

The "fix" was known to not even compile.  Duh.  That's not a fix.
That's just stupid.
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0481990b
...@@ -27,21 +27,6 @@ struct internal_container { ...@@ -27,21 +27,6 @@ struct internal_container {
struct class_device classdev; struct class_device classdev;
}; };
static void internal_container_klist_get(struct klist_node *n)
{
struct internal_container *ic =
container_of(n, struct internal_container, node);
class_device_get(&ic->classdev);
}
static void internal_container_klist_put(struct klist_node *n)
{
struct internal_container *ic =
container_of(n, struct internal_container, node);
class_device_put(&ic->classdev);
}
/** /**
* attribute_container_classdev_to_container - given a classdev, return the container * attribute_container_classdev_to_container - given a classdev, return the container
* *
...@@ -72,8 +57,7 @@ int ...@@ -72,8 +57,7 @@ int
attribute_container_register(struct attribute_container *cont) attribute_container_register(struct attribute_container *cont)
{ {
INIT_LIST_HEAD(&cont->node); INIT_LIST_HEAD(&cont->node);
klist_init(&cont->containers,internal_container_klist_get, klist_init(&cont->containers);
internal_container_klist_put);
down(&attribute_container_mutex); down(&attribute_container_mutex);
list_add_tail(&cont->node, &attribute_container_list); list_add_tail(&cont->node, &attribute_container_list);
...@@ -179,8 +163,8 @@ attribute_container_add_device(struct device *dev, ...@@ -179,8 +163,8 @@ attribute_container_add_device(struct device *dev,
#define klist_for_each_entry(pos, head, member, iter) \ #define klist_for_each_entry(pos, head, member, iter) \
for (klist_iter_init(head, iter); (pos = ({ \ for (klist_iter_init(head, iter); (pos = ({ \
struct klist_node *n = klist_next(iter); \ struct klist_node *n = klist_next(iter); \
n ? container_of(n, typeof(*pos), member) : \ n ? ({ klist_iter_exit(iter) ; NULL; }) : \
({ klist_iter_exit(iter) ; NULL; }); \ container_of(n, typeof(*pos), member);\
}) ) != NULL; ) }) ) != NULL; )
...@@ -222,7 +206,7 @@ attribute_container_remove_device(struct device *dev, ...@@ -222,7 +206,7 @@ attribute_container_remove_device(struct device *dev,
klist_for_each_entry(ic, &cont->containers, node, &iter) { klist_for_each_entry(ic, &cont->containers, node, &iter) {
if (dev != ic->classdev.dev) if (dev != ic->classdev.dev)
continue; continue;
klist_del(&ic->node); klist_remove(&ic->node);
if (fn) if (fn)
fn(cont, dev, &ic->classdev); fn(cont, dev, &ic->classdev);
else { else {
......
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