static ssize_t wait_probe_show(struct device *dev, struct device_attribute *attr, char *buf) { nd_synchronize(); device_for_each_child(dev, NULL, flush_regions_dimms); return sprintf(buf, "1\n"); }
int nvdimm_bus_check_dimm_count(struct nvdimm_bus *nvdimm_bus, int dimm_count) { int count = 0; /* Flush any possible dimm registration failures */ nd_synchronize(); device_for_each_child(&nvdimm_bus->dev, &count, count_dimms); dev_dbg(&nvdimm_bus->dev, "%s: count: %d\n", __func__, count); if (count != dimm_count) return -ENXIO; return 0; }
static ssize_t wait_probe_show(struct device *dev, struct device_attribute *attr, char *buf) { struct nvdimm_bus *nvdimm_bus = to_nvdimm_bus(dev); struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc; int rc; if (nd_desc->flush_probe) { rc = nd_desc->flush_probe(nd_desc); if (rc) return rc; } nd_synchronize(); device_for_each_child(dev, NULL, flush_regions_dimms); return sprintf(buf, "1\n"); }