base: class: fix class_remove_device to not corrupt the class list class_remove_device is supposed to remove the device from the class, not remove the class from its devices. Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx> --- drivers/base/class.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/class.c b/drivers/base/class.c index 28ae828d658a..fd7d6b2d7a29 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c @@ -21,7 +21,7 @@ int class_add_device(struct class *class, struct device *dev) void class_remove_device(struct class *class, struct device *dev) { - list_del(&class->devices); + list_del(&dev->class_list); } extern struct class __barebox_class_start[]; -- 2.39.2