Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx> writes: >> + if (!found) { >> + user = kzalloc(sizeof(struct omap_vdd_user_list), GFP_KERNEL); >> + if (!user) { >> + pr_err("%s: Unable to creat a new user for vdd_%s\n", >> + __func__, voltdm->name); >> + mutex_unlock(&vdd->scaling_mutex); >> + return -ENOMEM; >> + } >> + user->dev = dev; >> + } else { >> + plist_del(&user->node, &vdd->user_list); > > hmm... if we get here, we didn't find a match, so 'user' points to the > last element in the list (which is the highest voltage request, I > guess), or even NULL if the list is empty. Then, this node is deleted. > > -ECONFUSED OK, I'm a bit dense. It took me a few reads, now I think I know what's going on here. If we get here, we found a match, and you delete the existing value for that device so that inserting a new one (with a new voltage) will be kept in the right order. Right? Some comments might help clarify things here. Kevin -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html