Device properties framework fixes for 5.11-rc3

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).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAl/4mdsSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxmXYP/3xvuJ2XjhUuEcvOQrCcx9WqvbnMVSq+
 hBg8qL31/Da5V4XdlHyZJLjz1EP7WRquVPbOrpVHRRKfbnO0ouTm6TN9mrWY/1ES
 w+OfpieHaCJJ+WsDkhVdaH0bbkOfkB2MzXrfF+K3YXD+7K1MZcrugCY1/QZuyjDy
 L0vbmkOTuhCZyPxpQpT5X7foONAZZGlFXJgJtjLGw88WTb6MojKs1QQUX5MWgSKj
 7QMlGcjM8h3XB+IMfG5PKO08QTTDxxAENQ4EKPyY4Jl4QIct6812b/uqAvlO855I
 NbB0dS1Ip4xjR5Z//DbUvMUXyLBmVKAJaw48OfzAbcIo3yxdp5CK2UJcl+3Pz4bA
 4zknT0Jp+wbVpgy3rXl/TDdtr8IRoSgSEeH52rAFX2Tob4ooahA8qSE5Vgy2BPWK
 8G9QKXcuaz9ggQYwl/iXx/T9tMuVWORSax3X8fs0QPQcu41J0OdwFifr93FBGv1z
 kTHAaoLzwXxk7P5Z0HCP0cf5AOHifoxp8lok09+2CZ3/oIPSgu8GZKKpVgtV2PH6
 fZuG7grHobiAmtAXt+D7hcUszPnRJsaO/ODeq/EJg/TsEw61ipsR8scMkOqmFrVN
 SAK7OS1cvcPOMqTOtKzZtSke7qJvB6otNl0WjJ5TNDBeImsjnDF7Smpx3am8X3lz
 wsmE2IxH1on8
 =QH9o
 -----END PGP SIGNATURE-----

Merge tag 'devprop-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

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"
This commit is contained in:
Linus Torvalds 2021-01-08 15:45:47 -08:00
commit 78d42025e5

View File

@ -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;
}