From patchwork Mon Apr 22 17:28:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jorge Ramirez-Ortiz X-Patchwork-Id: 10911289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FD321575 for ; Mon, 22 Apr 2019 17:28:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1455F28715 for ; Mon, 22 Apr 2019 17:28:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0451728717; Mon, 22 Apr 2019 17:28:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A30CF28715 for ; Mon, 22 Apr 2019 17:28:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726305AbfDVR2a (ORCPT ); Mon, 22 Apr 2019 13:28:30 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35647 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbfDVR2a (ORCPT ); Mon, 22 Apr 2019 13:28:30 -0400 Received: by mail-wm1-f65.google.com with SMTP id y197so15261476wmd.0 for ; Mon, 22 Apr 2019 10:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zO+RNWwQbNoca0mKf5ETdBNVWZ7qpW34U6V/nkjkNlw=; b=XwLkvZ2nLSo5ns8GCzbqENm4/Kb7LWbiksFxVifZwFSqDyfrKbEulegHOmvohctDhn kSxdDmGh6y0EtpeQf/Cc9FFHNIHFZcHttLAz4s+Bv/GefAvo9idBmsD/QCpJKa6asrp7 cJ/s+Zd+LNtLZ4LQuaT/x41Coo1nStSghXzyu6qWQh6mAlmP4+c7ouyyXIow4lS0OA4/ Ht4l+E0yWDJfQuHwygUQ1aQa/PwM8/AlhN6Xa1kxcf0bSY6cG+8vLfFtslF3f+AfUqwO MV3otcOrVvj8WlnPF8Upiu1CivNcb0p7pYVtSDaWwUDmotKrVd5F2IzGo2wKpKILfROG aQig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zO+RNWwQbNoca0mKf5ETdBNVWZ7qpW34U6V/nkjkNlw=; b=FfZVzl/bf6aNkSkkV/YZCbxUp1poufCbz8CeKqzM6MwsmaCd4kxfE1TXW42CWAc0mC +bkLlSrjoQk3gLXSMd4BhLxLzCHCaUyMlNNNGKyNCHnakKs95UeQtqJwMx0gOeEgv+2g M0DFTELnY7jq5N8KRY47aEo6MJKcG4ja/+5XVc2A+lAiaQ7+1zehgipq1Bu9sCJhdloR iJ1VNjcdTchwtSJ1JxeGfH39T+VlZY2RFZgzegiiVY0Vuw0wulkZvj+ey0oa56WZsRg7 tLvvuaUoYXcSR581YDixMQQwOuNRs/bmNR2ejx8K8vNenNI+uSBJMl6x+7pLzYLesXCa Vj4w== X-Gm-Message-State: APjAAAVqEWdmuScWISh6yO5U+yER2m0RArxOvdKqqWlpU8o2jJ2/OL1a 1UVnPfwkqodOY/teA62bDM2EMA== X-Google-Smtp-Source: APXvYqxkHVb897/Z92KZwumXpNYwkHgtCf3ExnvZLNXTM9VhBJpE/B7+TlTIupLTo1vWDBYMAx7ckw== X-Received: by 2002:a1c:9c97:: with SMTP id f145mr13421548wme.139.1555954108686; Mon, 22 Apr 2019 10:28:28 -0700 (PDT) Received: from localhost.localdomain (200.red-83-34-200.dynamicip.rima-tde.net. [83.34.200.200]) by smtp.gmail.com with ESMTPSA id o16sm9033051wrw.10.2019.04.22.10.28.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Apr 2019 10:28:27 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge.ramirez-ortiz@linaro.org, lgirdwood@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, bjorn.andersson@linaro.org Subject: [PATCH] regulator: core: simplify return value on suported_voltage Date: Mon, 22 Apr 2019 19:28:24 +0200 Message-Id: <20190422172824.13720-1-jorge.ramirez-ortiz@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All the current clients of this API assume that 0 corresponds to a failure and non-zero to a pass therefore ignoring the need to handle a negative error code. This commit modifies the API to follow that standard since returning a negative (EINVAL) doesn't seem to provide enough value to justify the need to handle it. Signed-off-by: Jorge Ramirez-Ortiz --- drivers/regulator/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 186a37675b50..d872dfe75b63 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -3002,7 +3002,7 @@ EXPORT_SYMBOL_GPL(regulator_get_linear_step); * @min_uV: Minimum required voltage in uV. * @max_uV: Maximum required voltage in uV. * - * Returns a boolean or a negative error code. + * Returns a boolean. */ int regulator_is_supported_voltage(struct regulator *regulator, int min_uV, int max_uV) @@ -3026,7 +3026,7 @@ int regulator_is_supported_voltage(struct regulator *regulator, ret = regulator_count_voltages(regulator); if (ret < 0) - return ret; + return 0; voltages = ret; for (i = 0; i < voltages; i++) {