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 1fOoTC-0002KD-VX for barebox@lists.infradead.org; Fri, 01 Jun 2018 18:08:13 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Fri, 1 Jun 2018 20:07:49 +0200 Message-Id: <20180601180750.5436-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20180601180750.5436-1-u.kleine-koenig@pengutronix.de> References: <20180601180750.5436-1-u.kleine-koenig@pengutronix.de> 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 3/4] omap/am33xx_bbu: use file_write_flash() instead of its own variant To: barebox@lists.infradead.org VGhlcmUgYXJlIHR3byBkaWZmZXJlbmNlcyBiZXR3ZWVuIGZpbGVfd3JpdGVfZmxhc2goKSBhbmQg d3JpdGVfaW1hZ2UoKQood2hpY2ggaXMgcmVtb3ZlZCBpbiB0aGlzIHBhdGNoKToKCiAtIGZpbGVf d3JpdGVfZmxhc2goKSB1c2VzIHdyaXRlX2Z1bGwoKSB2cy4gd3JpdGUoKSBpbiB3cml0ZV9pbWFn ZSgpCiAtIGZpbGVfd3JpdGVfZmxhc2goKSBkb2Vzbid0IGVyYXNlIHRoZSB3aG9sZSBkZXZpY2Ug YnV0IG9ubHkgdGhlIG5lZWRlZAogICBzcGFjZQoKU28gdGhlIG5ldyBjb2RlIHNob3VsZCBiZSBt b3JlIHJvYnVzdCBhbmQgbWF5YmUgZXZlbiBmYXN0ZXIuCgpTaWduZWQtb2ZmLWJ5OiBVd2UgS2xl aW5lLUvDtm5pZyA8dS5rbGVpbmUta29lbmlnQHBlbmd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