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: 162620 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp2838946jan; Mon, 22 Apr 2019 10:28:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKroC7jtytGrNjfWVLWi1RJg6/eN198OqQwgV8Fl3VKnpDGb55pVBWJgithlaUonakK7jf X-Received: by 2002:a63:b03:: with SMTP id 3mr5532386pgl.267.1555954112172; Mon, 22 Apr 2019 10:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555954112; cv=none; d=google.com; s=arc-20160816; b=UY5siJP/VH33Wkb9E4yUq/TFHE9VXmNUKIjJvPF8xthZYxegwqEyUy0g0y4j6zKTkf VmzmZJpGwWZfBFcTDgEPd1a43wHqBmOu3k7M2B3h/yKu8eupNgIUGTNWLmmPYKK4qBB4 0AFfwGUrnF0kJ42TPzohMmd/zBBwiEc2jZYpL+5lU08gerqNtU8LxuBewEQ05Uqa8c2p W1rp3VfFhiK++TvKMz+FpX3k8AvjrqKKii/pkWAHvruqarxGeBcZexVOk71OFKBQF6bz yJBRf9NN3Y8EqzR9CAvZFmT7Oe3GFY0KXBMEUYKp/uyzDqfXDbNqGT5PZvomI55/CCog OxjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zO+RNWwQbNoca0mKf5ETdBNVWZ7qpW34U6V/nkjkNlw=; b=RrCk+7VpRKU6FoNYcB8+g03ifHUjW2+b7/qm9t42MUBSxExiaoYWjwKzJIiucmdE7u STmJv9Nc6Bo/T8vN93XhfIHKASljefdi1vVV4AQ5TEqGdk1iSrIW/PzH+sJcZNV7iaDe 8OYPqKZO8eLsc233Z/0yaoA2TSPzm4qr06hSzVhbgv6rnkXwBdc6y3uUdbTtG1+GxYv6 dm10MSNYV7r846ZMNQaF5zDSBfm93Nq05zIUTiFz+3m7aYnvQDwM5GzvdvU36BaXJ7Um 0QWfQTzFU9dYnuWiHg+0pMpdeNNMuKxiY9iP7+s6e86Xm8eVD9ppv7sDoMFv1+kGOU3/ 1yXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwLkvZ2n; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h24si12423719pgg.226.2019.04.22.10.28.31; Mon, 22 Apr 2019 10:28:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XwLkvZ2n; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726305AbfDVR2a (ORCPT + 15 others); 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-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 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(-) -- 2.21.0 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++) {