Lines Matching refs:nd_region
17 struct nd_region *nd_region = to_nd_region(dev); in nd_region_probe() local
19 if (nd_region->num_lanes > num_online_cpus() in nd_region_probe()
20 && nd_region->num_lanes < num_possible_cpus() in nd_region_probe()
23 num_online_cpus(), nd_region->num_lanes, in nd_region_probe()
26 nd_region->num_lanes); in nd_region_probe()
29 rc = nd_region_activate(nd_region); in nd_region_probe()
33 rc = nd_blk_region_init(nd_region); in nd_region_probe()
37 if (is_memory(&nd_region->dev)) { in nd_region_probe()
39 .start = nd_region->ndr_start, in nd_region_probe()
40 .end = nd_region->ndr_start + nd_region->ndr_size - 1, in nd_region_probe()
43 if (devm_init_badblocks(dev, &nd_region->bb)) in nd_region_probe()
45 nd_region->bb_state = sysfs_get_dirent(nd_region->dev.kobj.sd, in nd_region_probe()
47 if (!nd_region->bb_state) in nd_region_probe()
48 dev_warn(&nd_region->dev, in nd_region_probe()
50 nvdimm_badblocks_populate(nd_region, &nd_region->bb, &range); in nd_region_probe()
53 rc = nd_region_register_namespaces(nd_region, &err); in nd_region_probe()
64 nd_region->btt_seed = nd_btt_create(nd_region); in nd_region_probe()
65 nd_region->pfn_seed = nd_pfn_create(nd_region); in nd_region_probe()
66 nd_region->dax_seed = nd_dax_create(nd_region); in nd_region_probe()
92 struct nd_region *nd_region = to_nd_region(dev); in nd_region_remove() local
98 nd_region->ns_seed = NULL; in nd_region_remove()
99 nd_region->btt_seed = NULL; in nd_region_remove()
100 nd_region->pfn_seed = NULL; in nd_region_remove()
101 nd_region->dax_seed = NULL; in nd_region_remove()
109 sysfs_put(nd_region->bb_state); in nd_region_remove()
110 nd_region->bb_state = NULL; in nd_region_remove()
122 struct nd_region *nd_region = to_nd_region(dev); in nd_region_notify() local
124 if (is_memory(&nd_region->dev)) { in nd_region_notify()
126 .start = nd_region->ndr_start, in nd_region_notify()
127 .end = nd_region->ndr_start + in nd_region_notify()
128 nd_region->ndr_size - 1, in nd_region_notify()
131 nvdimm_badblocks_populate(nd_region, in nd_region_notify()
132 &nd_region->bb, &range); in nd_region_notify()
133 if (nd_region->bb_state) in nd_region_notify()
134 sysfs_notify_dirent(nd_region->bb_state); in nd_region_notify()