From patchwork Wed Dec 21 07:04:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 5921 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 05CE7242F7 for ; Wed, 21 Dec 2011 07:04:20 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id E863AA182F0 for ; Wed, 21 Dec 2011 07:04:19 +0000 (UTC) Received: by eaac11 with SMTP id c11so4242284eaa.11 for ; Tue, 20 Dec 2011 23:04:19 -0800 (PST) Received: by 10.205.141.78 with SMTP id jd14mr1722006bkc.107.1324451059623; Tue, 20 Dec 2011 23:04:19 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs32103bkc; Tue, 20 Dec 2011 23:04:19 -0800 (PST) Received: by 10.216.131.19 with SMTP id l19mr2803257wei.53.1324451058172; Tue, 20 Dec 2011 23:04:18 -0800 (PST) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id k5si2265618wed.128.2011.12.20.23.04.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Dec 2011 23:04:18 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of dmitry.antipov@linaro.org) smtp.mail=dmitry.antipov@linaro.org Received: by werp12 with SMTP id p12so3251429wer.37 for ; Tue, 20 Dec 2011 23:04:18 -0800 (PST) Received: by 10.216.136.74 with SMTP id v52mr8571351wei.13.1324451057925; Tue, 20 Dec 2011 23:04:17 -0800 (PST) Received: from [192.168.0.171] ([78.153.153.8]) by mx.google.com with ESMTPS id ei9sm11142908wid.0.2011.12.20.23.04.16 (version=SSLv3 cipher=OTHER); Tue, 20 Dec 2011 23:04:17 -0800 (PST) Message-ID: <4EF18515.9030800@linaro.org> Date: Wed, 21 Dec 2011 11:04:53 +0400 From: Dmitry Antipov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: linaro-dev@lists.linaro.org CC: patches@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH] regulator: use usleep_range() instead of mdelay()/udelay() >From 00753f3d48c4b6c45c1778c3e37bc9949ed79e77 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 21 Dec 2011 11:01:42 +0400 Subject: [PATCH] regulator: use usleep_range() instead of mdelay()/udelay() --- drivers/regulator/core.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 938398f..183ded8 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1379,12 +1379,7 @@ static int _regulator_enable(struct regulator_dev *rdev) trace_regulator_enable_delay(rdev_get_name(rdev)); - if (delay >= 1000) { - mdelay(delay / 1000); - udelay(delay % 1000); - } else if (delay) { - udelay(delay); - } + usleep_range(delay, delay + 1000); trace_regulator_enable_complete(rdev_get_name(rdev));