From patchwork Wed Nov 14 03:54:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 12828 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 DDBA523FC2 for ; Wed, 14 Nov 2012 04:00:25 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 8350DA18DDE for ; Wed, 14 Nov 2012 04:00:25 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so9780iag.11 for ; Tue, 13 Nov 2012 20:00:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=+NwYOB0DC1XjxcPtIAJhXEx+3RBCJ8E6TfOe3vS3HbI=; b=jqQSmVB4hvzVjLb9xuRjRPtvlXmf/ivKNuaxayoYGS/xC/xLm5hJWL2El9bWGun8Yf 9cWiUmpVnowfZ4uetEgzwT6m159HiXog5Vl10CMGguFPYPLIZ74kiuZeCeoh4q9At+aP 0XU/o/5aU2lOiAxu7elFT4XlBl8JNXoZ3iQQ/CC66NsnkXMPYy1F2MVICA4YnDZcoWrI NC2/pjV7327egD9CC3OArC8ckHYOeV7N8UeeVZRJCUub0Y7mU4ZAWgjfDameHnXyDl/3 AcMkfddmv4XiXYm5BizilOfYsyuGH+vlVFu4NUM5BINn7nb2+wvYmHPj/AcgQCdUlmml zVvQ== Received: by 10.50.91.195 with SMTP id cg3mr618330igb.57.1352865624882; Tue, 13 Nov 2012 20:00:24 -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.50.67.148 with SMTP id n20csp610306igt; Tue, 13 Nov 2012 20:00:24 -0800 (PST) Received: by 10.66.83.67 with SMTP id o3mr3213587pay.5.1352865623712; Tue, 13 Nov 2012 20:00:23 -0800 (PST) Received: from mail-da0-f41.google.com (mail-da0-f41.google.com [209.85.210.41]) by mx.google.com with ESMTPS id wu8si16393803pbc.183.2012.11.13.20.00.23 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Nov 2012 20:00:23 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-da0-f41.google.com with SMTP id i14so5750dad.14 for ; Tue, 13 Nov 2012 20:00:23 -0800 (PST) Received: by 10.66.77.201 with SMTP id u9mr3009558paw.6.1352865622976; Tue, 13 Nov 2012 20:00:22 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id oj1sm7027371pbb.19.2012.11.13.20.00.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Nov 2012 20:00:22 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org Cc: broonie@opensource.wolfsonmicro.com, patches@linaro.org Subject: [PATCH v2] regulator: core: Update regulator_is_supported_voltage for fixed voltages Date: Wed, 14 Nov 2012 09:24:26 +0530 Message-Id: <1352865266-25286-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQk2JF/Aw7hEAOpx99LFIxqqbT38thDsdnAbcpnOTAilyFTr/5JKr3ILPoIv26Iv53mjPckl Commit c5f3939b8fe0 ("regulator: core: Support fixed voltages in regulator_is_supported_voltage()") returns success when the regulator voltage is less than both min_uV and max_uV. Modify this to return success only when the regulator voltage is within the specified range. Signed-off-by: Tushar Behera --- Changes since v1: * Return success when the regulator voltage is within the specified range. drivers/regulator/core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 1a35251..e90e5c3 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1974,7 +1974,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) { ret = regulator_get_voltage(regulator); if (ret >= 0) - return (min_uV >= ret && ret <= max_uV); + return (ret >= min_uV && ret <= max_uV); else return ret; }