From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-sn1nam02on0103.outbound.protection.outlook.com ([104.47.36.103] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fMAAh-0000pV-P1 for barebox@lists.infradead.org; Fri, 25 May 2018 10:42:34 +0000 From: "Baeuerle, Florian" Date: Fri, 25 May 2018 10:41:54 +0000 Message-ID: <717577a612f7c48dcb520a970c3ddde7e6b40980.camel@allegion.com> Content-Language: en-US Content-ID: MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] commands/of_node: add option to apply changes as fixup To: "barebox@lists.infradead.org" QW5hbG9nb3VzIHRvIHRoZSBvZl9wcm9wZXJ0eSBjb21tYW5kLCBhZGQgYW4gLWYgb3B0aW9uIHRv IHRoZSBvZl9ub2RlDQpjb21tYW5kLiBUaGlzIG9wdGlvbiBkZWZlcnMgdGhlIGRldmljZSB0cmVl IG1vZGlmaWNhdGlvbiB1bnRpbCBib290DQp0aW1lIGFuZCB0aHVzIGFwcGxpZXMgdGhlIG1vZGlm aWNhdGlvbiBhcyBhIGZpeHVwIG9uIHRoZSBsaW51eCBkZXZpY2UNCnRyZWUuDQoNClNpZ25lZC1v ZmYtYnk6IEZsb3JpYW4gQsOkdWVybGUgPGZsb3JpYW4uYmFldWVybGVAYWxsZWdpb24uY29tPg0K LS0tDQogY29tbWFuZHMvb2Zfbm9kZS5jIHwgMTA2ICsrKysrKysrKysrKysrKysrKysrKysrKysr KysrKysrLS0tLS0tLS0tLS0tLQ0KIDEgZmlsZSBjaGFuZ2VkLCA3NSBpbnNlcnRpb25zKCspLCAz MSBkZWxldGlvbnMoLSkNCg0KZGlmZiAtLWdpdCBhL2NvbW1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