From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RiNHG-0007h3-O0 for barebox@lists.infradead.org; Wed, 04 Jan 2012 09:37:00 +0000 Received: from localhost.localdomain (unknown [82.240.38.71]) by smtp2-g21.free.fr (Postfix) with ESMTP id 77BA04B01CB for ; Wed, 4 Jan 2012 10:36:53 +0100 (CET) From: =?UTF-8?q?Eric=20B=C3=A9nard?= Date: Wed, 4 Jan 2012 10:36:46 +0100 Message-Id: <1325669809-32637-2-git-send-email-eric@eukrea.com> In-Reply-To: <1325669809-32637-1-git-send-email-eric@eukrea.com> References: <1325669809-32637-1-git-send-email-eric@eukrea.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-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH v4 2/5] dfu: fill bwPollTimeout and better handle detach To: barebox@lists.infradead.org LSBid1BvbGxUaW1lb3V0IGlzIHNldCB0byAxMCBtcywgZnJvbSB0aGUgREZVIHNwZWMsIHRoaXMK aXMgdGhlIG1pbmltdW0gdGltZSwgaW4gbWlsbGlzZWNvbmRzLCB0aGF0IHRoZSBob3N0IHNob3Vs ZAp3YWl0IGJlZm9yZSBzZW5kaW5nIGEgc3Vic2VxdWVudCBERlVfR0VUU1RBVFVTIHJlcXVlc3Qu CldpdGhvdXQgdGhpcywgSSBnZXQgMjUgc2Vjb25kcyB2YWx1ZSBhbmQgZGZ1LXV0aWwgd2FpdHMg dHdpY2UgMjVzCmR1cmluZyBkb3dubG9hZAotIHdoZW4gaW4gSURMRSBhbmQgcmVjZWl2aW5nIERF VEFDSCwgZmlyc3QgcmV0dXJuIDAgdG8gbWFrZQpkZnUtdXRpbCBoYXBweS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