From patchwork Mon Jan 28 15:55:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 156802 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3691772jaa; Mon, 28 Jan 2019 09:36:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5mIznjo1G9nNWYdroWRbOB0sYT+7ottOWBGMCMh5DesIpTS36/IIyH0E9d9dzV3xf5xDhQ X-Received: by 2002:a63:6bc1:: with SMTP id g184mr21022622pgc.25.1548696963435; Mon, 28 Jan 2019 09:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696963; cv=none; d=google.com; s=arc-20160816; b=RjqvBRyDyFEsPTITY/rX/D6KEqr25OKlx5nWGUR1eHiZ4iZL6DiwDR9NeRAgcyZh05 oFG9JNqOjjQOfLlzhwrIYIgYOD82Q/xf5JNEn3KKItH/FQtdE6QqndTUX7KI9XQYG79u nZZGoqTj0ZsJJ6yhxoW+WCtJ5oX2D98ua1ifOq+KQEVS8NtCQ9Cz1He8sK/qpI5uVCRg TdIrikUcJy+NbJCUHDRDSNZhxSU15lsP7Bb/L8YuHKYFDtR/SvVwGyGQiP5AQOZGfkQm VsKfjkN1LPxYiassJQMgDldmNbr8RSBw3sm+ekcSPaSj31zOAmUB/0zr8u0VImaYrJR/ OOQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SM1B9I6t8HFBSAnmnKVD5EISrf58W+phlPhNn1H5SHI=; b=bMsqkha3ZCkZgM37JqoY4dSRMEy4TCJshlfx9kme9ewkD2Kttc0AI0P9pk6FLiYZn4 DZf1rnTBh15Fc3T9NJrPHh3qDXo/AVjI9Cc8e9YKtlPiumdY0wXeElEq55/ya19gNjiP sNIRxydV7iPy5xVr1IadTz+tv5xk+W5JIdWLrNtQa32c/+dJj7cJJ7ERHPnA1p3k60YU w2ZCPyTxpOPT84P79ftKw7mUcbBS64X908/Zn3FE57iHAAOh7AheUNgXDHV77DKtyznf 9hBkEHkGYG9nf9fvWySCjGvhSpw0OGxpQsVQdMjtQbvcqlXH4FO+qFpBXB3du6mkyFum SnAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BW6BxRUl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 j10si30787562pgt.155.2019.01.28.09.36.02; Mon, 28 Jan 2019 09:36:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=BW6BxRUl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1729989AbfA1RgA (ORCPT + 31 others); Mon, 28 Jan 2019 12:36:00 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34916 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729857AbfA1PzS (ORCPT ); Mon, 28 Jan 2019 10:55:18 -0500 Received: by mail-wr1-f68.google.com with SMTP id 96so18659566wrb.2 for ; Mon, 28 Jan 2019 07:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SM1B9I6t8HFBSAnmnKVD5EISrf58W+phlPhNn1H5SHI=; b=BW6BxRUlOzvur7L2/Cfdyc8uYKO3JNnbliumNpAzwqMo59groRSPfT8lEzXEksR5KI e9+CqZ17J42SXVm8RRelyiG8IO1DVkLJbBSRMpfb/97XY/r/eFOrgEcI38tU0u2K6MWr PvMs8b+m4G+g+5KNKZJZB15zWWtZw2s4RKDK4= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=SM1B9I6t8HFBSAnmnKVD5EISrf58W+phlPhNn1H5SHI=; b=gLW9XKeg5efjHdINYEBhDZ6Km/ASEy1vmhtndDDjOLpRZVU2z+dU2gLFxw03tynPa/ PABiHlgPCvk3OfO8QnGUqIsBRCVLqU5S3ikz3XfNUO6rtdcqB8EyZVP3T0pPLyqbUa5j W3B0Bv2lWAHZq1yGqwrZM93KZtsTkKt2RBWZ0DsVEPRw2aWiSOHSa0Mlk+doo+PN/2GK ggT5SJOMdRS8+i24ETPeCRQJX+w4/GcJMTk0Qcsgr4ksmpOczvxple6M7CzmVku+4z+B NtknLgmt11zzfrjgcckUiVz09aakyzTK+YrOupItFUXqufHCKpjcDy4DsiRYBEqzyyK0 A1TQ== X-Gm-Message-State: AJcUukf22xd6mdN+6jfcig5Fx1g+7kOf38Xckeohsieg3Hqto75rYXM2 9yBJKoMGEOrwSeWusbJeUMwiuHK9+yM= X-Received: by 2002:a5d:4a45:: with SMTP id v5mr21265063wrs.7.1548690917342; Mon, 28 Jan 2019 07:55:17 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id p6sm145140485wrx.50.2019.01.28.07.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 07:55:16 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 08/13] nvmem: core: Fix of_nvmem_cell_get() for optional cells Date: Mon, 28 Jan 2019 15:55:01 +0000 Message-Id: <20190128155506.25566-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190128155506.25566-1-srinivas.kandagatla@linaro.org> References: <20190128155506.25566-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alban Bedel of_nvmem_cell_get() should return -ENOENT when a cell isn't defined, otherwise callers can't distinguish between a missing cell and other errors. Signed-off-by: Alban Bedel Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index cf2e1091fe89..f8c43da6f2ca 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -1031,7 +1031,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, const char *id) cell_np = of_parse_phandle(np, "nvmem-cells", index); if (!cell_np) - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOENT); nvmem_np = of_get_next_parent(cell_np); if (!nvmem_np)