Skip to content

Commit 107b04e

Browse files
santoshsdjbw
authored andcommitted
ndtest: Add compatability string to treat it as PAPR family
Since this module is written to be platform agnostic, the module is made part of the PAPR_FAMILY. ndctl identifies the family using the compatible string inside of_node dir-entry. Signed-off-by: Santosh Sivaraj <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 9a27e10 commit 107b04e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/testing/nvdimm/test/ndtest.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,34 @@ static int ndtest_ctl(struct nvdimm_bus_descriptor *nd_desc,
6565
return 0;
6666
}
6767

68+
static ssize_t compatible_show(struct device *dev,
69+
struct device_attribute *attr, char *buf)
70+
{
71+
return sprintf(buf, "nvdimm_test");
72+
}
73+
static DEVICE_ATTR_RO(compatible);
74+
75+
static struct attribute *of_node_attributes[] = {
76+
&dev_attr_compatible.attr,
77+
NULL
78+
};
79+
80+
static const struct attribute_group of_node_attribute_group = {
81+
.name = "of_node",
82+
.attrs = of_node_attributes,
83+
};
84+
85+
static const struct attribute_group *ndtest_attribute_groups[] = {
86+
&of_node_attribute_group,
87+
NULL,
88+
};
89+
6890
static int ndtest_bus_register(struct ndtest_priv *p)
6991
{
7092
p->bus_desc.ndctl = ndtest_ctl;
7193
p->bus_desc.module = THIS_MODULE;
7294
p->bus_desc.provider_name = NULL;
95+
p->bus_desc.attr_groups = ndtest_attribute_groups;
7396

7497
p->bus = nvdimm_bus_register(&p->pdev.dev, &p->bus_desc);
7598
if (!p->bus) {

0 commit comments

Comments
 (0)