From patchwork Thu Mar 24 14:45:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 64366 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp696524lbc; Thu, 24 Mar 2016 07:46:42 -0700 (PDT) X-Received: by 10.66.145.194 with SMTP id sw2mr13194775pab.69.1458830795904; Thu, 24 Mar 2016 07:46:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si1987457par.197.2016.03.24.07.46.35; Thu, 24 Mar 2016 07:46:35 -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 S1752987AbcCXOq3 (ORCPT + 1 other); Thu, 24 Mar 2016 10:46:29 -0400 Received: from mail-wm0-f49.google.com ([74.125.82.49]:34992 "EHLO mail-wm0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbcCXOqR (ORCPT ); Thu, 24 Mar 2016 10:46:17 -0400 Received: by mail-wm0-f49.google.com with SMTP id l68so239769307wml.0 for ; Thu, 24 Mar 2016 07:46:16 -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=YjJO1DUCpuTuYyhmRMveuoouWs7t1SfPT1Rc1u3B80LleVM7P0Q6mn8dmNmmrsShF5 f6Xs116ZPuAQpecULDKKDtoc91TDuDOvUSZwADT14x4ftNxXO271DX+ANogWf066JupF 8m1UqU732+0qDkZC7BzHv1qVmfa1qacyDr9Jj+G1oubYdzqVi9aPcJGfM7HEiVxRompT bRVwKtdji8+czX+E3rPKh20FoKwcCcsmnIIvfgcftgND42n/IERplS7z27kKLhkjSRQP yufkr87ZoLxOBEKMlnzEqKrm4PHgk4K3x1iYa2M36NtLWlCyqk1AajXZPrQr16+15kwj 6ctA== 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=QSQjGY3uf6X5WnhojJTOVr/ilfYxZJhMiZjtZgSJegQ6GhDMY7ppfvxolwEeFarT/U zNLjw781tHbwjoX+eE7+q5wxzZx6tkEmFPXSrzy0gWqG2HFlLCnCsVbzym56ooDm6lv7 PD6YfI2JHPDsORTP8LZ7tz1h3Xio8xA3J4tLaDEDNC0zm0H1jKMlg8v+KKjn/4YHYswA pSdPM6XiY6EWFobtSNQ6LmPwScTwbsWAgjmoGtwnWdlSo2s6EwLtNa6HxS8IUkXfVWV3 Hrjm4VVkpbMDlAlBKdlXx9SZ8YLErBpMIqzQw4Qi0ATpu//yh4MN2mB4Og4E0ppyE6xu u1mQ== X-Gm-Message-State: AD7BkJLzVoqknjUEJrlPwMj/bOuUHBeX+jHbkkfSjAJwL4dn9LC50vAIN9TU4NOMDDQEULfL X-Received: by 10.28.142.202 with SMTP id q193mr10734623wmd.60.1458830776096; Thu, 24 Mar 2016 07:46:16 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id k125sm27255752wmb.14.2016.03.24.07.46.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Mar 2016 07:46:15 -0700 (PDT) From: Bartosz Golaszewski To: Wolfram Sang , linux-i2c , LKML Cc: Andrew Lunn , Bartosz Golaszewski Subject: [PATCH 05/13] eeprom: at24: replace msleep() with usleep_range() Date: Thu, 24 Mar 2016 15:45:59 +0100 Message-Id: <1458830767-23816-6-git-send-email-bgolaszewski@baylibre.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458830767-23816-1-git-send-email-bgolaszewski@baylibre.com> References: <1458830767-23816-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;