Commit a49c4f6a authored by Patrick Mochel's avatar Patrick Mochel Committed by Linus Torvalds

[PATCH] device removal

The problem was that when the refcount hit 0, it was unconditionally
assuming that it had been added, which is wrong.  The patch below
corrects that, and fixes the Oops when loading the floppy driver.
parent 441a964b
......@@ -274,7 +274,7 @@ void put_bus(struct bus_type * bus)
return;
list_del_init(&bus->node);
spin_unlock(&device_lock);
BUG_ON(bus->present);
WARN_ON(bus->present);
bus_remove_dir(bus);
}
......
......@@ -136,9 +136,10 @@ void put_device(struct device * dev)
list_del_init(&dev->g_list);
up(&device_sem);
WARN_ON(dev->state != DEVICE_GONE);
WARN_ON(dev->state == DEVICE_REGISTERED);
device_del(dev);
if (dev->state == DEVICE_GONE)
device_del(dev);
}
void device_del(struct device * dev)
......
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