Skip to content

Commit

Permalink
[SCSI] Revert "final klist fixes"
Browse files Browse the repository at this point in the history
Revert commit 2b7d6a8.

The "fix" was known to not even compile.  Duh.  That's not a fix.
That's just stupid.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Linus Torvalds committed Sep 8, 2005
1 parent 0481990 commit df4edad
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions drivers/base/attribute_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,6 @@ struct internal_container {
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
*
Expand Down Expand Up @@ -72,8 +57,7 @@ int
attribute_container_register(struct attribute_container *cont)
{
INIT_LIST_HEAD(&cont->node);
klist_init(&cont->containers,internal_container_klist_get,
internal_container_klist_put);
klist_init(&cont->containers);

down(&attribute_container_mutex);
list_add_tail(&cont->node, &attribute_container_list);
Expand Down Expand Up @@ -179,8 +163,8 @@ attribute_container_add_device(struct device *dev,
#define klist_for_each_entry(pos, head, member, iter) \
for (klist_iter_init(head, iter); (pos = ({ \
struct klist_node *n = klist_next(iter); \
n ? container_of(n, typeof(*pos), member) : \
({ klist_iter_exit(iter) ; NULL; }); \
n ? ({ klist_iter_exit(iter) ; NULL; }) : \
container_of(n, typeof(*pos), member);\
}) ) != NULL; )


Expand Down Expand Up @@ -222,7 +206,7 @@ attribute_container_remove_device(struct device *dev,
klist_for_each_entry(ic, &cont->containers, node, &iter) {
if (dev != ic->classdev.dev)
continue;
klist_del(&ic->node);
klist_remove(&ic->node);
if (fn)
fn(cont, dev, &ic->classdev);
else {
Expand Down

0 comments on commit df4edad

Please sign in to comment.