Commit 78d42025 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull device properties framework fixes from Rafael Wysocki:
 "Revert a problematic commit that went in during the 5.10 cycle and
  improve the kerneldoc description of the function affected by it (both
  changes from Bard Liao)"

* tag 'devprop-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  device property: add description of fwnode cases
  Revert "device property: Keep secondary firmware node secondary by type"
parents fb9ca0be 3f7bddaf
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -4414,6 +4414,12 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode)
 *
 * Set the device's firmware node pointer to @fwnode, but if a secondary
 * firmware node of the device is present, preserve it.
 *
 * Valid fwnode cases are:
 *  - primary --> secondary --> -ENODEV
 *  - primary --> NULL
 *  - secondary --> -ENODEV
 *  - NULL
 */
void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
{
@@ -4432,8 +4438,9 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
	} else {
		if (fwnode_is_primary(fn)) {
			dev->fwnode = fn->secondary;
			/* Set fn->secondary = NULL, so fn remains the primary fwnode */
			if (!(parent && fn == parent->fwnode))
				fn->secondary = ERR_PTR(-ENODEV);
				fn->secondary = NULL;
		} else {
			dev->fwnode = NULL;
		}