History

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

Pull device properties framework fixes from Rafael Wysocki: "Fix the secondary firmware node handling while manipulating the primary firmware node for a given device (Andy Shevchenko)" * tag 'devprop-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Don't clear secondary pointer for shared primary firmware node device property: Keep secondary firmware node secondary by type

Linus Torvalds committed 6 years ago

Commit a5a16052 parents ee17690 99aed921 file · +3 −1Browse files

Unified · Split

drivers/base/core.c+3−1
@@ -4264,6 +4264,7 @@ static inline bool fwnode_is_primary(struct fwnode_handle *fwnode) · 4263 unmodified lines
42644264 */
42654265 void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode)
42664266 {
4267+ struct device *parent = dev->parent;
42674268 struct fwnode_handle *fn = dev->fwnode;
42684269
42694270 if (fwnode) {
@@ -4278,7 +4279,8 @@ void set_primary_fwnode(struct device *dev, struct fwnode_handle *fwnode) · 8 unmodified lines
42784279 } else {
42794280 if (fwnode_is_primary(fn)) {
42804281 dev->fwnode = fn->secondary;
4281− fn->secondary = NULL;
4282+ if (!(parent && fn == parent->fwnode))
4283+ fn->secondary = ERR_PTR(-ENODEV);
42824284 } else {
42834285 dev->fwnode = NULL;
42844286 }