From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAHiW-0003Zt-3p for barebox@lists.infradead.org; Wed, 10 Oct 2018 16:52:23 +0000 Message-ID: <1539190319.3515.48.camel@pengutronix.de> From: Lucas Stach Date: Wed, 10 Oct 2018 18:51:59 +0200 In-Reply-To: <20181009173805.26181-10-andrew.smirnov@gmail.com> References: <20181009173805.26181-1-andrew.smirnov@gmail.com> <20181009173805.26181-10-andrew.smirnov@gmail.com> 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: Re: [PATCH v2 09/17] of: Port latest of_device_make_bus_id() implementation To: Andrey Smirnov , barebox@lists.infradead.org SGkgQW5kcmV5LAoKQW0gRGllbnN0YWcsIGRlbiAwOS4xMC4yMDE4LCAxMDozNyAtMDcwMCBzY2hy aWViIEFuZHJleSBTbWlybm92Ogo+IENvZGUgaW1wbGVtZW50aW5nIG9mX2RldmljZV9tYWtlX2J1 c19pZCgpIGluIEJhcmVib3ggdXNlcyByYXRoZXIgb2xkCj4gaW1wbGVtZW50YXRpb24gZnJvbSBM aW51eCBrZXJuZWwgYW5kIGhhcyBhIHZlcnkgc2lnbmlmaWNhbiBsaW1pdGF0aW9uCj4gaW4gdGhh dCBpdCB3aWxsIHByb2R1Y2UgaWRlbnRpY2FsIG5hbWVzIGZvciBkaWZmZXJlbnQgRFQgbm9kZXMg dGhhdAo+IGhhcHBlbiB0byBoYXZlIHRoZSBzYW1lIG5vZGUgbmFtZSBhcyB3ZWxsIGFzICJyZWci IHByb3BlcnR5Lgo+IAo+ID4gT25lIHN1Y2ggZXhhbXBsZSwgdGhhdCB0aXJ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