of: dynamic: changeset prop-update revert fix
authorPantelis Antoniou <pantelis.antoniou@konsulko.com>
Mon, 9 May 2016 13:20:42 +0000 (16:20 +0300)
committerRob Herring <robh@kernel.org>
Mon, 16 May 2016 12:29:12 +0000 (07:29 -0500)
When reverting an update property changeset entry that created a
property the reverse operation is a remove property and not an update.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/dynamic.c

index 75ce30dfdd5f04d2229acb3b78869020c4a7a265..3033fa3250dc486c85f422fbd49000218b3c8c47 100644 (file)
@@ -498,6 +498,11 @@ static void __of_changeset_entry_invert(struct of_changeset_entry *ce,
        case OF_RECONFIG_UPDATE_PROPERTY:
                rce->old_prop = ce->prop;
                rce->prop = ce->old_prop;
+               /* update was used but original property did not exist */
+               if (!rce->prop) {
+                       rce->action = OF_RECONFIG_REMOVE_PROPERTY;
+                       rce->prop = ce->prop;
+               }
                break;
        }
 }