Message ID | 1449038369-752-1-git-send-email-krivenok.dmitry@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 6bb691ac089c |
Headers | show |
On Tue, Dec 1, 2015 at 10:39 PM, Dmitry V. Krivenok <krivenok.dmitry@gmail.com> wrote: > This simple change hides pfn_seed attribute for non pmem > regions because they don't support pfn anyway. > > Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com> > --- Looks good I'll queue it for 4.5.
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;
This simple change hides pfn_seed attribute for non pmem regions because they don't support pfn anyway. Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com> --- drivers/nvdimm/region_devs.c | 3 +++ 1 file changed, 3 insertions(+)