From patchwork Wed Dec 2 06:39:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Krivenok X-Patchwork-Id: 7743111 Return-Path: X-Original-To: patchwork-linux-nvdimm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C8A99F350 for ; Wed, 2 Dec 2015 06:39:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45477204EC for ; Wed, 2 Dec 2015 06:39:42 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4653C204EB for ; Wed, 2 Dec 2015 06:39:41 +0000 (UTC) Received: from ml01.vlan14.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 238581A2002; Tue, 1 Dec 2015 22:39:41 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com [IPv6:2a00:1450:4010:c07::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3A5511A2002 for ; Tue, 1 Dec 2015 22:39:40 -0800 (PST) Received: by lfs39 with SMTP id 39so3555360lfs.3 for ; Tue, 01 Dec 2015 22:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oxyE77Kt3JMNiAG5ao4P9CNbj+t5rxL1WShrAs8kUsk=; b=R8i7Q+Z789DPTsbTA7PFGg9oreIZcg6tJBjjvhPdbxd4YJP84lvuaAB3NoFWGY/yxV Mw48O6yHZTIgX9jhxhdqdJL3DmoNSOXrIuYavrlZf48TKcpzBDYV11QCwm3Q0HLrk99Q 6OlvP7j5wYu9I+NPA2DE1XjtAJpKtRkeS1V5mxxD8i7+YAHqgLNvrA/fsc/vxh8LxYop IyT+hg5r77i2m8v8kXkXamgP270LId7/LF/ZkgBp2N8GLIDcgyqiFe3TEcBvUxlhY+8o TB3pjcEv7JhGiEX/kEtZvcNDnSd4K0RrP8V5lW6EL/oU3wRFWKUGlxewcsC4I/U0IQmr RS6g== X-Received: by 10.25.137.84 with SMTP id l81mr996816lfd.45.1449038377976; Tue, 01 Dec 2015 22:39:37 -0800 (PST) Received: from localhost.localdomain ([93.100.147.134]) by smtp.gmail.com with ESMTPSA id 42sm211918lfv.29.2015.12.01.22.39.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 22:39:37 -0800 (PST) From: "Dmitry V. Krivenok" To: Dan Williams Subject: [PATCH] nvdimm: do not show pfn_seed for non pmem regions Date: Wed, 2 Dec 2015 09:39:29 +0300 Message-Id: <1449038369-752-1-git-send-email-krivenok.dmitry@gmail.com> X-Mailer: git-send-email 2.6.2 Cc: Ross Zwisler , linux-kernel@vger.kernel.org, "Dmitry V. Krivenok" , linux-nvdimm@lists.01.org X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This simple change hides pfn_seed attribute for non pmem regions because they don't support pfn anyway. Signed-off-by: Dmitry V. Krivenok --- drivers/nvdimm/region_devs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvdimm/region_devs.c b/drivers/nvdimm/region_devs.c index 529f3f0..3d730d1 100644 --- a/drivers/nvdimm/region_devs.c +++ b/drivers/nvdimm/region_devs.c @@ -406,6 +406,9 @@ static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n) struct nd_interleave_set *nd_set = nd_region->nd_set; int type = nd_region_to_nstype(nd_region); + if (!is_nd_pmem(dev) && a == &dev_attr_pfn_seed.attr) + return 0; + if (a != &dev_attr_set_cookie.attr && a != &dev_attr_available_size.attr) return a->mode;