Message ID | 20190128155506.25566-11-srinivas.kandagatla@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3691412jaa; Mon, 28 Jan 2019 09:35:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qrmI1NmRpUqYnDvgopV7aIXki25HCsVzsRrvZltc9+tx+eBJ6+S0utMYzhMHv/NLn43Sq X-Received: by 2002:a63:a91a:: with SMTP id u26mr20281614pge.349.1548696938670; Mon, 28 Jan 2019 09:35:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696938; cv=none; d=google.com; s=arc-20160816; b=prHFUGwyfxOvm+7Tpk132f1en3fOoumQXjdPXdhHc8ze14P23Dg5yKTI0z0W4X6L8V iSckE0+rFqZZ7Xs1EDlANUhsKj7H5PtwLHBW++cjqp61prH0OwIx8bu28kC1jlGyN3o9 LtEdh5yAMKGBtoGROP8pIYXZaBNXTQM6TLtLLZxqfoJ3+6c2WnNKeo85W3yYWnD5kXWM 3+uVeIPB+VIJqrz5mOj2gGPOmanWwb/U15ZSawUfFjqoqZQ5wf93BGu2CsPm3d5DNTni nwqRDi7oGC+E5GNval8GjQF1F82/pck1iGzVjW+QgU3fhGYXgiMYbu+bRYX/7jwgLaCA ncIQ== 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=g0/pWPJ9dN7bFakh4TwkUfEapIBrvkN+RgDjhJ97VaY=; b=GjMenE3q1Isk3d3O317jrie4aeobRyV+jEcGzy1NjMV6turTxlDAKNJ15hn3/6knX/ eTmL2YodsHTmBsXnsaE0euT2thBEkj0unnKJlmwvrPE7aWrfS+L5nz22QXNffRMlSJoP Xxy+tGI4mcOOKXm64mWSqwqMNd/qaH/vNQSFiItZqaMW9NTFlITclwCRwNIg0Y9FFcVj j8vPYOigrIX16cSy6wr8ZH5jXZMgJpS0TDaEX1oudOeGL9TrccPL37d/wnDLrBD8KsZJ CdxV0KwFUyNvNw2faUGoub0TRE9HfwVQMSpCmIph1ZjyFFUHiuH82RrUbzGozBRRezuo L5mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XX45LbDL; 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: <linux-kernel-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c12si22682824pgh.257.2019.01.28.09.35.38; Mon, 28 Jan 2019 09:35:38 -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=XX45LbDL; 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 S1730376AbfA1Rfg (ORCPT <rfc822;igor.opaniuk@linaro.org> + 31 others); Mon, 28 Jan 2019 12:35:36 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40961 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728572AbfA1PzV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 28 Jan 2019 10:55:21 -0500 Received: by mail-wr1-f67.google.com with SMTP id x10so18589832wrs.8 for <linux-kernel@vger.kernel.org>; Mon, 28 Jan 2019 07:55:20 -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=g0/pWPJ9dN7bFakh4TwkUfEapIBrvkN+RgDjhJ97VaY=; b=XX45LbDLTNBdDRPJ8E3DbnJM9ifQQ5fhMisTGa7brzYR2ZY6kjoahFlFgXDb8eu/ZB 54Y26gr9wTWC4yGD0D/r9gbXz/TqZ2vtpXB+hMe+KUeAXKNdHCeCTtFP1w7yqad5VMDQ 54aJVzPR0imzId/4a1WRzUIJyEhmdKTogSVS8= 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=g0/pWPJ9dN7bFakh4TwkUfEapIBrvkN+RgDjhJ97VaY=; b=cNDHo117eD8lLKSrDkDkk+5bSN16v+b8k5ibZ5azDKLpk1T49nYfZiKG+aK8fOg/jQ IlRXOErTcL69PhVw6HWwqzuq9+CGhE8keKrPwNAXECUh3TQlKDmJT2PnpTGqfL0Wmswd p4GXmSSgjTO5S4FyWWwIFrX6y+xQ9ZnQG1O6hqBJxDt9wFkBEjLDpbY8LxmUxN1P2RYu WNGsmgGZxsZJRAyGE0Q2PSFkshFH06qOOTOfJyD38JZ9ddnuwalLogDf66NNUUfI/slN ENCAmgqs1OvGNenZtketAt2Wd1BPhjXRSd12p1lbCIbrznHAbyJmIOKv2ka4C3Le/MdB KoJA== X-Gm-Message-State: AHQUAuZGTd8Cjk57ZZfQBmpeujkEC+ZJoewNbTf8Myb0250+ddYZZvUV CXihm/q4Cxk1R0oOYSrecN47+utvpUo= X-Received: by 2002:adf:ef88:: with SMTP id d8mr1130981wro.163.1548690919658; Mon, 28 Jan 2019 07:55:19 -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.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 07:55:18 -0800 (PST) From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 10/13] nvmem: core: Properly handle connection ID in of_nvmem_device_get() Date: Mon, 28 Jan 2019 15:55:03 +0000 Message-Id: <20190128155506.25566-11-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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org |
Series |
nvmem: patches for 5.1
|
expand
|
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index a2ad44104aa2..a749a5cb0a4e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -839,13 +839,14 @@ struct nvmem_device *of_nvmem_device_get(struct device_node *np, const char *id) { struct device_node *nvmem_np; - int index; + int index = 0; - index = of_property_match_string(np, "nvmem-names", id); + if (id) + index = of_property_match_string(np, "nvmem-names", id); nvmem_np = of_parse_phandle(np, "nvmem", index); if (!nvmem_np) - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOENT); return __nvmem_device_get(nvmem_np, NULL); }