Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753085Ab2FNWIF (ORCPT ); Thu, 14 Jun 2012 18:08:05 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:43969 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202Ab2FNWID (ORCPT ); Thu, 14 Jun 2012 18:08:03 -0400 From: Philip Rakity To: linux-kernel@vger.kernel.org, broonie@opensource.wolfsonmicro.com Cc: linux-mmc@vger.kernel.org, Philip Rakity Subject: [PATCH 2/2] regulator: core.c Only delay when setting voltage requires this Date: Thu, 14 Jun 2012 15:07:56 -0700 Message-Id: <1339711676-3488-1-git-send-email-prakity@marvell.com> X-Mailer: git-send-email 1.7.0.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1158 Lines: 42 minor optimization: move delay code to where delay is set and thus where it is used vs in the main line path. Signed-off-by: Philip Rakity --- drivers/regulator/core.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5b04916..4407ed2 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2166,14 +2166,14 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev, delay); delay = 0; } - } - /* Insert any necessary delays */ - if (delay >= 1000) { - mdelay(delay / 1000); - udelay(delay % 1000); - } else if (delay) { - udelay(delay); + /* Insert any necessary delays */ + if (delay >= 1000) { + mdelay(delay / 1000); + udelay(delay % 1000); + } else if (delay) { + udelay(delay); + } } if (ret == 0 && best_val >= 0) -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/