libnvdimm: Simplify root read-only definition for the 'resource' attribute
[sfrench/cifs-2.6.git] / drivers / nvdimm / pfn_devs.c
index 17ceac5b5313d8fa786598a2903dc28e2cc693e5..b94f7a7e94b8b0819584b704d4b80ba95b19f3f6 100644 (file)
@@ -218,7 +218,7 @@ static ssize_t resource_show(struct device *dev,
 
        return rc;
 }
-static DEVICE_ATTR_RO(resource);
+static DEVICE_ATTR(resource, 0400, resource_show, NULL);
 
 static ssize_t size_show(struct device *dev,
                struct device_attribute *attr, char *buf)
@@ -269,16 +269,8 @@ static struct attribute *nd_pfn_attributes[] = {
        NULL,
 };
 
-static umode_t pfn_visible(struct kobject *kobj, struct attribute *a, int n)
-{
-       if (a == &dev_attr_resource.attr)
-               return 0400;
-       return a->mode;
-}
-
 static struct attribute_group nd_pfn_attribute_group = {
        .attrs = nd_pfn_attributes,
-       .is_visible = pfn_visible,
 };
 
 const struct attribute_group *nd_pfn_attribute_groups[] = {