From patchwork Mon Jan 28 15:55:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 156761 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3582018jaa; Mon, 28 Jan 2019 07:55:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN5csGV75CapsU4y3AG3bPn2u3Uq/x3iITdj9o7XtaftLK6WrYtqJa+JfXv3CWWxNg8UtnMu X-Received: by 2002:a63:9e19:: with SMTP id s25mr20275720pgd.203.1548690924610; Mon, 28 Jan 2019 07:55:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548690924; cv=none; d=google.com; s=arc-20160816; b=znk3mFtG12EVQN0jzRfwzxRDyhwNIT9dle6TM6Z/38ugA8yuflGjJiKulo/OCTEhiE /JWBXZ2EoHlWTnRisYXjnF5rxHTg+45Igxg+yZiRL0B+Vd+JDyd/AlDZXRCDcJ2nckrn zotCTvJ7XJKei1qiREmYozEZo/M7wrQieltoq1MoXy6YM2haL8WO3ZarrMuP2Vqoeq9V h0KY+oipN1NS4O0MeJBJcU3OdK5XgaTzqcc+cKedmWCIE8iCTB0RM1m3n/7/1Nhp9rg/ QvD4HoayTv+nNPsi8sprfIUiNlJq/C5L4RTBBvsiuUxQtVpIuJ4Ncqzw2kmxFKINSc4m DqXQ== 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=EzzauLuRu7S4DI8YrZtbq8X+zovdFXkJQc9myBytVls=; b=sx5v4hU6xZf1G4kC24/v+YPzkE2Ok5Ln9FaFrBlF83XlgTZtUJ/p/Ucbdv2it2Y40E /9oiZqg+HbzPP2cy6oDEgS8it8f+qdfSJG+QyHp0Enzvq0nVTWc2Pw4rRBdWCHhGbrdF x3//BseNxK9LoYCV+T2Q8HnEBFKyaFG6PIQzn5LhzWCZmcfYbDuqv2mlHwKZ4Ts7Wz04 1M7Qm7bZeNfku3Kc+mhRmdNP8U2e9pGz8dkMTK2uWBl1Ecxo2HPTLFKKQuB/hVlPnpF8 WyQQVJYuiKvWK5aMGRKJCHdAftU2choAJCixIxn4KDjml1pIOAoCQFJWIOVHKBWz+NR7 2khQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f0jFbjCA; 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 o27si32886687pgl.53.2019.01.28.07.55.24; Mon, 28 Jan 2019 07:55:24 -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=f0jFbjCA; 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 S1729879AbfA1PzW (ORCPT + 31 others); Mon, 28 Jan 2019 10:55:22 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39805 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729434AbfA1PzR (ORCPT ); Mon, 28 Jan 2019 10:55:17 -0500 Received: by mail-wr1-f67.google.com with SMTP id t27so18614858wra.6 for ; Mon, 28 Jan 2019 07:55:16 -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=EzzauLuRu7S4DI8YrZtbq8X+zovdFXkJQc9myBytVls=; b=f0jFbjCA+wizq41/gotVHqLqwPq00jSl0pprOR48HBDrBkyrWDohdYSA8yFonqdbZc 5k3Wtpvi7daPEezkDYb242jq4esQiXyoxXKD/sFT5xCGs0ZAiS/l6Wb37bDMsuBlI7Ui CIb1CIqmh5QYqFrkPXW1RqHtdz7V2Ccenz1Us= 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=EzzauLuRu7S4DI8YrZtbq8X+zovdFXkJQc9myBytVls=; b=rwO0ggMlcHxRiSZlzkfUHWbFHfwFEYTfd7eGlTIZNIu2QG8jwa4yDzqV+GJuCTMAE3 bBheEaTDj/YvtL+WQFIzIFE9krnuqRUB7AqOcvdvFqpoEkcklXoo134TaOpW2CEaCjN6 FsGtOiAp7Hqko65msLxdjygxkdm/z8i8lgWukIzFZ1Q6tHMoHGxaqwx0BQHgjMYw2JTX rOZ+2OmVeko2dFGpp/GEWD3aRgG0xKTGQxaO2Lkb6O5x9TK7t0E+Ls5rXUHljYBY+WeE 1Sh/PARCn+NiySMRE0isqWrXRaTXTlg5LqMZbYWenQgeU0mQLHWcD8cpsNuM1Qm3wmvR fdQw== X-Gm-Message-State: AJcUukfkHH5fFutD9HOxvdULQC87ZwoNIlO87MO0+/HS4CkRRZ4gIdPE NO4EgYdXJRb9MnQRTAuN+zylUA== X-Received: by 2002:adf:ff09:: with SMTP id k9mr21346704wrr.97.1548690916153; Mon, 28 Jan 2019 07:55:16 -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.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Jan 2019 07:55:15 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 07/13] nvmem: core: Set the provider read-only when no write callback is given Date: Mon, 28 Jan 2019 15:55:00 +0000 Message-Id: <20190128155506.25566-8-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 If no write callback is given the device should be marked as read-only. While at it also move from a bit or to a logical or as that is a logical expression. Signed-off-by: Alban Bedel Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index f7301bb4ef3b..cf2e1091fe89 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -646,8 +646,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) config->name ? config->id : nvmem->id); } - nvmem->read_only = device_property_present(config->dev, "read-only") | - config->read_only; + nvmem->read_only = device_property_present(config->dev, "read-only") || + config->read_only || !nvmem->reg_write; if (config->root_only) nvmem->dev.groups = nvmem->read_only ?