From patchwork Fri Dec 15 14:06:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 122103 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp519932qgn; Fri, 15 Dec 2017 06:09:43 -0800 (PST) X-Google-Smtp-Source: ACJfBos8G80oMEkgVBbEs96nb8Z1ZZfFE5odX1PEVBN+6ouiNkhY1nNKP1Pdt2oVgt6ZdtYsjshJ X-Received: by 10.101.80.138 with SMTP id r10mr11875488pgp.428.1513346983230; Fri, 15 Dec 2017 06:09:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513346983; cv=none; d=google.com; s=arc-20160816; b=BTLo0eZalP+4cK6nBLsNZWEv9LEcpMxIkNz98Dhj/KZrC/T6BxqZRTHNaTd+olqzKL rtTlK8OKKhYSK8zlE2CLbJ3Cf+8YW9cAG0/NB0vuv7AhsxTweRmCsKfI/UbUK+CfA8BQ Lvb8QYrbGMb9Y/ApO2lJmGNDF6AqasyehZYUQfMf/cyezXWC+shKWrYPAF2rx9nllcjO +2K2HDTSL97sMdEE45eSlzU+teZ9dI+1bBsgLLIhiOMOXEDdQ0AAPN1yjDY+OxB5crZO KILWfJ8fMTiVmGToJsOywUsfkEPhDYkK4BNT8faOfTCudk77fFj+2zJplNzyD/ZyEW5d hYvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=JuCPohq0SZA28IZ4vcYw72Oqcw+aHNWdebvFV3N/YhA=; b=x05bAh5uFPP3uwb0FgVg+5h676C05CzZT/lCmgCf947y0DEYleAnu0u7kZlROHB2zd r1vaNjkQm9cghuqkAywSVNrO4EBrBUdPLl0Q9tkb0f/o+DNBaRzzB7n7KhK0To/7ZBbg PrvwASjJk+tL7yGQOzp9h6SqXWw32ifuoe1mTggNAeI5Ow1jpZxPyWS9hJEa78C+5Lvr ZL7GniOWl1VWDyx3T1O7WkRqGI6NbuyOLjrCzQp7how9w0wAZbl76SyRvAx9nDxWshJa sclUySPd2z5zp4mHVmIE6nmF8wEkAY/O/4P7qJxLV0c/J5L8xlhdz/EG9hi6f6cyRX7D v3Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Agq+bG1W; 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 b89si5186665pfc.304.2017.12.15.06.09.42; Fri, 15 Dec 2017 06:09:43 -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=Agq+bG1W; 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 S1756571AbdLOOJj (ORCPT + 20 others); Fri, 15 Dec 2017 09:09:39 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:45630 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756178AbdLOOJe (ORCPT ); Fri, 15 Dec 2017 09:09:34 -0500 Received: by mail-wm0-f68.google.com with SMTP id 9so17686112wme.4 for ; Fri, 15 Dec 2017 06:09:33 -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; bh=JuCPohq0SZA28IZ4vcYw72Oqcw+aHNWdebvFV3N/YhA=; b=Agq+bG1WW4sCymtyEgxGj8nVsAc6/duwDHSZijEyRAZvn57ikHKlpoN2gqLhDt6QQV rP3qDj+WuxHu1KPdVR2r0jcq+5L3aj8tlbudxM7YqwscwASs1Bt5S6Fj8GxAIz35zfF0 YRQUIC7Ubn7W8pgpUp3wqP3b8+R9Wv9ju8I10= 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; bh=JuCPohq0SZA28IZ4vcYw72Oqcw+aHNWdebvFV3N/YhA=; b=gFaU9cL4E/9Sp8oeMopoeUX6p8uemeLjPthPVU3QGz4Of4cMPk4fiDVyCgUaSEDYkU teGs3qAvTZfZdB1g/QbIBuFFxQj6rVJTzaZY4/otLATod3zac7+c5AeyAueb/QOZVh68 EqMvBnQyB1z40w9uE0impcktVGVQOkseBXfvqDG1CJLFrrqHQingGuyrK0e6+tmLV7WY f5z/dgFb8FoVKIcOekDGnoPQ2CxXE8x0xRuRwy9J94L8H4F9qlc1fd8cfkjv79UM3Dfq QIwJVOh/ZezN9iyQxc+h1RNb/DyoDfEFiOlYNkkFJR5ZPL4ZlaRITy+GQ4JZt0qu9n1i ggMg== X-Gm-Message-State: AKGB3mKL4O3H5D6PE3099g34oUzskeHhdZlrOH/itxW6FnOvf3dTpkWP x+MZjpaE/Ca1Poe+AlkJgVIIdQ== X-Received: by 10.28.105.204 with SMTP id z73mr5290398wmh.37.1513346973094; Fri, 15 Dec 2017 06:09:33 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id n7sm6295034wra.23.2017.12.15.06.09.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Dec 2017 06:09:32 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Heiner Kallweit Subject: [PATCH 3/6] nvmem: core: switch to device_property_present for reading property "read-only" Date: Fri, 15 Dec 2017 14:06:06 +0000 Message-Id: <20171215140609.17193-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171215140609.17193-1-srinivas.kandagatla@linaro.org> References: <20171215140609.17193-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Heiner Kallweit Switch to more generic device_property_present to consider also non-DT properties. Signed-off-by: Heiner Kallweit Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 2.15.0 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 4f37c9f3d120..35a3dbeea324 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -444,7 +444,6 @@ static int nvmem_setup_compat(struct nvmem_device *nvmem, struct nvmem_device *nvmem_register(const struct nvmem_config *config) { struct nvmem_device *nvmem; - struct device_node *np; int rval; if (!config->dev) @@ -473,13 +472,12 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->priv = config->priv; nvmem->reg_read = config->reg_read; nvmem->reg_write = config->reg_write; - np = config->dev->of_node; - nvmem->dev.of_node = np; + nvmem->dev.of_node = config->dev->of_node; dev_set_name(&nvmem->dev, "%s%d", config->name ? : "nvmem", config->name ? config->id : nvmem->id); - nvmem->read_only = of_property_read_bool(np, "read-only") | + nvmem->read_only = device_property_present(config->dev, "read-only") | config->read_only; if (config->root_only)