Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5065544ybb; Tue, 24 Mar 2020 10:18:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsLAiuoIR6NKEdJF61gsjpgDsVLaqY/DvJOsXi3G3bzCmny7Y33fFZI+QIIp7/8nFh8V3ob X-Received: by 2002:a9d:6d82:: with SMTP id x2mr13285408otp.50.1585070332831; Tue, 24 Mar 2020 10:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585070332; cv=none; d=google.com; s=arc-20160816; b=Dvkxin8mlCLV+Fz5MYmWmTDxOYzH/5gx/GbGUesWlXuoTog8Vi2DfUvrFZR3HHv9O8 ppVGo7v4Yj/d0jHBlxc+n6MtfDNUEx6sIVpzZj/vxhx5FPell/3SVtED3hSR5+o35JYB Bji8WZoTPcTYOx0OnoD8Fufyq1ATSIw+pHBzGYpdbc2wZa8l23SAnH6JFWcji3gxJItq g+jIcrZK/43Arn1VcDbO3sagyN1bYAcXbK8nYmCxoRo5+2mRW89tjLhHZUIk/aPrViK5 AEZpYP/7LOcISFkE6OXt/isR+rtqqEd297mjlOSMaK095U/4v3X66XzcVliflNO6ymHN FAdw== 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=oIHNfLP97i+iXHu3Xs3oiPWqbaiyFrdjyqDTxXvHYmc=; b=XY2lpt59Cm8zEbaFqylDCjNkiZAD/9XDSDKqYgq8EmEeqfVnuIigrn4/J4a/PPLSnM uDoink9C2myk9kMV1lha1gDTb+8M3NdITCLqh5wPAWoXIFPojQ6rywDOrc8F3r0ZjLhh OUpmIHPFxPKZQTJ2A4trefoSbp2k54efTPuTVYWHArdHAfjpHwQamRjKEqbQCLP3OmeA 7YoTc10A5UIzw7YzYFvPg7+CAjc+KcnUCMblILMhFR+f9JX5z2QlVPB1CZ0WEgSAxARk /sp2zEYZzEe82SjbSRhcKl5Oqc/0C8nTeQvwgkt6WZt6BujjtndbumpjyhVRcGcXezwu DYxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wsW374mO; 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 t71si9173206oif.84.2020.03.24.10.18.39; Tue, 24 Mar 2020 10:18:52 -0700 (PDT) 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=wsW374mO; 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 S1727689AbgCXRQT (ORCPT + 99 others); Tue, 24 Mar 2020 13:16:19 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35895 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727571AbgCXRQS (ORCPT ); Tue, 24 Mar 2020 13:16:18 -0400 Received: by mail-wm1-f67.google.com with SMTP id g62so4444062wme.1 for ; Tue, 24 Mar 2020 10:16:17 -0700 (PDT) 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=oIHNfLP97i+iXHu3Xs3oiPWqbaiyFrdjyqDTxXvHYmc=; b=wsW374mOQPitsWt3vt2KwtkDWsZMU8m6589gm4fuard7w9RdhLRNpaxiCYlzBVhmHY DpsETlUEE7c7bXqL7kkVolG+owKSIL8oAy8seQua82SE6rHhrmFK6oFLeddvk+nr4REO mS1Rm7KDRdlwyE2GGQtBpx6hlDVF8jbe7fHes0LjrDuKgm4GGUfqT76E9IN2yQ2Vpm+h uoeAJSM9ULRBt22HlqkTzCFGNIejwmZTky1R70wV/4Il6Uoo+RUVuRqayfn0+kbim9KL 4Kj7J+UmbDOlcB+owNGDxyBFR9LeYhDK7E3tjaJsgKy6JcNSJZGoH2XR/P3uaAvQujT6 gNQg== 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=oIHNfLP97i+iXHu3Xs3oiPWqbaiyFrdjyqDTxXvHYmc=; b=L7MkGQjxJ8nr3A8Red2JaZ6AnR1GPpiGRFMaKX76xRuMUr5hxCly955dJXLxpnJQ6A 3AQZxADFa4LC0zs8egvXwjeAIYYEJ9kuDF/oD36UenXzqaDXDZOzKfS5BsbdeV9usrhb k0r1Q9mTPJ+k7KQr/GzjiAeo29UIOsR0wLpM7SFclaCygH5h5iMqwNTG6+pGTj97l98c kyeJ8Ue9j+xgU5UZ6XwvOrffVyCSG4y4Lozhyra32UiJ78SFZW2SHcOYDrdUk/AXsAQH v4pjK2q3/0kny+2Odull6Jqu5CcORAg3zSLqX0vc0RZBdDqXfYcOTNVMxhU/hyTf9+e3 Pcog== X-Gm-Message-State: ANhLgQ0A2ywgrOeyZLTfDzxtJthWnN+xAfWPFAsa86jLZtG6aZoxKcvE 4cU+nWoYbRpQg80i/N7vBiImBA== X-Received: by 2002:a1c:648b:: with SMTP id y133mr6570766wmb.173.1585070176382; Tue, 24 Mar 2020 10:16:16 -0700 (PDT) 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 m11sm5269514wmf.9.2020.03.24.10.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:16:15 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, nicholas.johnson-opensource@outlook.com.au, Srinivas Kandagatla Subject: [PATCH 2/3] nvmem: core: add root_only member to nvmem device struct Date: Tue, 24 Mar 2020 17:15:59 +0000 Message-Id: <20200324171600.15606-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200324171600.15606-1-srinivas.kandagatla@linaro.org> References: <20200324171600.15606-1-srinivas.kandagatla@linaro.org> 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 As we are planning to move to use sysfs is_bin_visible callback, having root_only as part of nvmem_device will help decide correct permissions. Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 1 + drivers/nvmem/nvmem.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index e8f7bea93abf..7d28e1cca4e0 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -377,6 +377,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->dev.type = &nvmem_provider_type; nvmem->dev.bus = &nvmem_bus_type; nvmem->dev.parent = config->dev; + nvmem->root_only = config->root_only; nvmem->priv = config->priv; nvmem->type = config->type; nvmem->reg_read = config->reg_read; diff --git a/drivers/nvmem/nvmem.h b/drivers/nvmem/nvmem.h index be0d66d75c8a..16c0d3ad6679 100644 --- a/drivers/nvmem/nvmem.h +++ b/drivers/nvmem/nvmem.h @@ -20,6 +20,7 @@ struct nvmem_device { struct kref refcnt; size_t size; bool read_only; + bool root_only; int flags; enum nvmem_type type; struct bin_attribute eeprom; -- 2.21.0