From patchwork Thu Mar 24 16:19:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 64409 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp757041lbc; Thu, 24 Mar 2016 09:21:24 -0700 (PDT) X-Received: by 10.98.9.129 with SMTP id 1mr14102917pfj.163.1458836470713; Thu, 24 Mar 2016 09:21:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4si2946545pap.178.2016.03.24.09.21.10; Thu, 24 Mar 2016 09:21:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@baylibre-com.20150623.gappssmtp.com; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757595AbcCXQVG (ORCPT + 1 other); Thu, 24 Mar 2016 12:21:06 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36212 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756509AbcCXQTx (ORCPT ); Thu, 24 Mar 2016 12:19:53 -0400 Received: by mail-wm0-f42.google.com with SMTP id u125so19712014wmg.1 for ; Thu, 24 Mar 2016 09:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9DXiZj/1pm3qhR0mlPuxyjW5YG7nQGY52JEMjAHlSHQ=; b=J57aUr0SKKPlEg0cO7aEdPqy1yuOCiKEaDxmil5i/0wVzBi47v7yLXEu9yFB/5cFyk GwPlgQGRkhUHEfsxMVZVkbdNI+eVatRHlfE880patcNOrrD8P0moYyppMrPkx73jgXRa 6o4PnR3ZiIAAbnkyiNazOGpdNblUWeXTqbbZlPZ5id0dGDrKe6Uu7kZ2qqR2YDr/bcQt xPYlLnOLsl4yjGJYhI9W4KbFKA69ARTy74QQGW7Bho23DNvEUUGQCbFAIbQkGKG5G7Pz CUpkzQk2EjMH56TMSp3tp9JhleUvlrDhd0hHlxuMbX95ew3EOzG5R7SXZqrkP54fHAB7 AHFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9DXiZj/1pm3qhR0mlPuxyjW5YG7nQGY52JEMjAHlSHQ=; b=SPWw8WaRCZUkPtBsoa1VgvLfpRXD4YNqClSeykPXaOjTG3pZnYVvcuF6hXR5nGbzFn U60ycg3LkX6CUJVct86oFPTD4EmF7mX847h5u1I+gFpUlVUApaewX66JTmG5R6RcUWRv cDMruOOSRyhI3qQpGZYeH9m1D6j5ojcxzySD7HNrKc/++I3Gxni9E0l4trPqSnf02OE6 MteVtwrK3ODRcAgaG1J5S1hhnZCPhsHQSYCbAZla2PNKa2wqKEMzXt++jI2D5OQTZO6J jW+7wYNlOa3Kb9qcDI1CxTeSGq5Ap9TcMzx8gsu+t3PNFsSXwaNP+dhd0Vze4F5Oe+tV keOQ== X-Gm-Message-State: AD7BkJIm2PGO/oWF3XqX/Mik1JMUM9+SncWSCHR/KafTvGyxLm2zBmu3QxKP/0C6XZOZ7slm X-Received: by 10.28.227.69 with SMTP id a66mr32993220wmh.57.1458836391502; Thu, 24 Mar 2016 09:19:51 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id k124sm8370718wmb.11.2016.03.24.09.19.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Mar 2016 09:19:50 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang , linux-i2c , LKML Cc: Andrew Lunn , Bartosz Golaszewski Subject: [PATCH v2 05/13] eeprom: at24: replace msleep() with usleep_range() Date: Thu, 24 Mar 2016 17:19:35 +0100 Message-Id: <1458836383-6668-6-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458836383-6668-1-git-send-email-bgolaszewski@baylibre.com> References: <1458836383-6668-1-git-send-email-bgolaszewski@baylibre.com> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org We cannot expect msleep(1) to actually sleep for a period shorter than 20 ms. Replace all calls to msleep() with usleep_range(). Signed-off-by: Bartosz Golaszewski --- drivers/misc/eeprom/at24.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c index 9e01428..bc5be1e 100644 --- a/drivers/misc/eeprom/at24.c +++ b/drivers/misc/eeprom/at24.c @@ -240,8 +240,7 @@ static ssize_t at24_eeprom_read(struct at24_data *at24, char *buf, if (status == count) return count; - /* REVISIT: at HZ=100, this is sloooow */ - msleep(1); + usleep_range(1000, 1500); } while (time_before(read_time, timeout)); return -ETIMEDOUT; @@ -355,8 +354,7 @@ static ssize_t at24_eeprom_write(struct at24_data *at24, const char *buf, if (status == count) return count; - /* REVISIT: at HZ=100, this is sloooow */ - msleep(1); + usleep_range(1000, 1500); } while (time_before(write_time, timeout)); return -ETIMEDOUT;