From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.x-arc.co.uk ([217.6.246.34] helo=root.phytec.de) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UpeKH-0005px-MG for barebox@lists.infradead.org; Thu, 20 Jun 2013 12:51:01 +0000 Received: from idefix.phytec.de (idefix.phytec.de [172.16.0.10]) by root.phytec.de (Postfix) with ESMTP id 885CEBF0F6 for ; Thu, 20 Jun 2013 14:45:42 +0200 (CEST) From: =?UTF-8?q?Teresa=20G=C3=A1mez?= Date: Thu, 20 Jun 2013 14:50:28 +0200 Message-Id: <1371732630-27966-2-git-send-email-t.gamez@phytec.de> In-Reply-To: <1371732630-27966-1-git-send-email-t.gamez@phytec.de> References: <1371732630-27966-1-git-send-email-t.gamez@phytec.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 1/3] i2c-omap: cleanup cpu_is functions To: barebox@lists.infradead.org Y3B1X2lzX29tYXAyNDMwKCkgaXMgc2V0IHdoZW4gQ09ORklHX0FSQ0hfT01BUCBpcyBlbmFibGVk LgpUaGlzIGZpdHMgZm9yIGFsbCBPTUFQL0FNMzN4eCBib2FyZHMgc3VwcG9ydGVkIGluIGJhcmVi b3guCkNsZWFuZWQgdXAgYWxsIGNvbmRpdGlvbnMgdGhhdCB1c2UgdGhlIGNwdV9pc19vbWFwMjQz MCgpLgpBbHNvIHJlbW92ZWQgc29tZSB1bnVzZWQgZGVmaW5lcy4KClNpZ25lZC1vZmYtYnk6IFRl cmVzYSBHw6FtZXogPHQuZ2FtZXpAcGh5dGVjLmRlPgotLS0KIGRyaXZlcnMvaTJjL2J1c3Nlcy9p MmMtb21hcC5jIHwgIDE1OSArKysrKysrKysrKysrKystLS0tLS0tLS0tLS0tL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