Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2849383imu; Sun, 6 Jan 2019 11:30:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN6br/azYIanf8jokZki/19b16dZyYeTE0LbaxIdIMq0PKrh02UQJurlSXz9+z43Wyuhnbum X-Received: by 2002:a63:d047:: with SMTP id s7mr8451493pgi.311.1546803010415; Sun, 06 Jan 2019 11:30:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546803010; cv=none; d=google.com; s=arc-20160816; b=L1rf0GpCISbSlVqNzqAR6WXv+i+v9nqdF0/o6pwOJlVVZzajXNSTID8qgeNghM6DRx /65ao9bUDoBCMnerxqh0OEc+kKqRQnvvBAwgIxL4lKa3USn0jnXOtA9jKMjlSuDkwza8 cVbRgDT/DnUjDeW8kM6lHaaq8PCmDgxgsnr8aoKxMiF8nhdtQI11kCY3DOPeYajg1Z5w R2XojIueJvnsDazrzNtwyhFwGpu+NqGctYU0zNcuQM4/puBagIJwEEpvPNErqkpEtSSA FnvZMeIsimQ7MwttLz6VYFrszsyR67Szsw+5v7f4LmCsG+bsFIDlTTzSkf9AJaXBmLZw XvKw== 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; bh=pofgt6NNFwrk1QNAjymzQnX3IjmNt4K2ojPmTLxhzeE=; b=F5JhLZK81zRDJNYFpe2LxW7z6E0rsffwsvm/EGnuuHxC5owwlLjevtoCouiSLMbRLE 5OasqUiHJ/EZs9AturPgho9pIxkbIb4lpM/41JXFlAFKhHcaKJeUV65Pf/7tN36dcz+U nqYv/gzuJ9RO+y2iZU2qj6hoUaGxgauNuhhq49Cz3hM6cnYOG67Bp9x15Ps5zNOUwKll uZ+sGWjH4Xp0PTNNg6omw1zLT4ATdkTERbeqVWXTL4W/Vlev2Rlm1RjkxHX4ssrJYWth /ARc+DEVg8Y9rWddLuE8DhQdWm7rN778xurfcXr7w+2yO2MoaRzUDLIGJn+74PTDZT1i U2Jw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si58032239plq.345.2019.01.06.11.29.55; Sun, 06 Jan 2019 11:30:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726275AbfAFT2o (ORCPT + 99 others); Sun, 6 Jan 2019 14:28:44 -0500 Received: from smtp3-g21.free.fr ([212.27.42.3]:31371 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfAFT2o (ORCPT ); Sun, 6 Jan 2019 14:28:44 -0500 Received: from localhost.localdomain (unknown [IPv6:2a02:8108:4840:8f74:143e:fcd5:beb7:2140]) (Authenticated sender: albeu) by smtp3-g21.free.fr (Postfix) with ESMTPA id 64D7B13F838; Sun, 6 Jan 2019 20:28:36 +0100 (CET) From: Alban Bedel To: Srinivas Kandagatla Cc: linux-kernel@vger.kernel.org, Alban Bedel Subject: [PATCH 2/8] nvmem: core: Fix of_nvmem_cell_get() for optional cells Date: Sun, 6 Jan 2019 20:28:14 +0100 Message-Id: <20190106192820.12558-3-albeu@free.fr> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190106192820.12558-1-albeu@free.fr> References: <20190106192820.12558-1-albeu@free.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.19.1