aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/nvdimm/namespace_devs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvdimm/namespace_devs.c')
-rw-r--r--drivers/nvdimm/namespace_devs.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index 2d8d7e554877..a16e52251a30 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -410,7 +410,7 @@ static ssize_t alt_name_store(struct device *dev,
410 struct nd_region *nd_region = to_nd_region(dev->parent); 410 struct nd_region *nd_region = to_nd_region(dev->parent);
411 ssize_t rc; 411 ssize_t rc;
412 412
413 device_lock(dev); 413 nd_device_lock(dev);
414 nvdimm_bus_lock(dev); 414 nvdimm_bus_lock(dev);
415 wait_nvdimm_bus_probe_idle(dev); 415 wait_nvdimm_bus_probe_idle(dev);
416 rc = __alt_name_store(dev, buf, len); 416 rc = __alt_name_store(dev, buf, len);
@@ -418,7 +418,7 @@ static ssize_t alt_name_store(struct device *dev,
418 rc = nd_namespace_label_update(nd_region, dev); 418 rc = nd_namespace_label_update(nd_region, dev);
419 dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); 419 dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc);
420 nvdimm_bus_unlock(dev); 420 nvdimm_bus_unlock(dev);
421 device_unlock(dev); 421 nd_device_unlock(dev);
422 422
423 return rc < 0 ? rc : len; 423 return rc < 0 ? rc : len;
424} 424}
@@ -1077,7 +1077,7 @@ static ssize_t size_store(struct device *dev,
1077 if (rc) 1077 if (rc)
1078 return rc; 1078 return rc;
1079 1079
1080 device_lock(dev); 1080 nd_device_lock(dev);
1081 nvdimm_bus_lock(dev); 1081 nvdimm_bus_lock(dev);
1082 wait_nvdimm_bus_probe_idle(dev); 1082 wait_nvdimm_bus_probe_idle(dev);
1083 rc = __size_store(dev, val); 1083 rc = __size_store(dev, val);
@@ -1103,7 +1103,7 @@ static ssize_t size_store(struct device *dev,
1103 dev_dbg(dev, "%llx %s (%d)\n", val, rc < 0 ? "fail" : "success", rc); 1103 dev_dbg(dev, "%llx %s (%d)\n", val, rc < 0 ? "fail" : "success", rc);
1104 1104
1105 nvdimm_bus_unlock(dev); 1105 nvdimm_bus_unlock(dev);
1106 device_unlock(dev); 1106 nd_device_unlock(dev);
1107 1107
1108 return rc < 0 ? rc : len; 1108 return rc < 0 ? rc : len;
1109} 1109}
@@ -1286,7 +1286,7 @@ static ssize_t uuid_store(struct device *dev,
1286 } else 1286 } else
1287 return -ENXIO; 1287 return -ENXIO;
1288 1288
1289 device_lock(dev); 1289 nd_device_lock(dev);
1290 nvdimm_bus_lock(dev); 1290 nvdimm_bus_lock(dev);
1291 wait_nvdimm_bus_probe_idle(dev); 1291 wait_nvdimm_bus_probe_idle(dev);
1292 if (to_ndns(dev)->claim) 1292 if (to_ndns(dev)->claim)
@@ -1302,7 +1302,7 @@ static ssize_t uuid_store(struct device *dev,
1302 dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf, 1302 dev_dbg(dev, "result: %zd wrote: %s%s", rc, buf,
1303 buf[len - 1] == '\n' ? "" : "\n"); 1303 buf[len - 1] == '\n' ? "" : "\n");
1304 nvdimm_bus_unlock(dev); 1304 nvdimm_bus_unlock(dev);
1305 device_unlock(dev); 1305 nd_device_unlock(dev);
1306 1306
1307 return rc < 0 ? rc : len; 1307 return rc < 0 ? rc : len;
1308} 1308}
@@ -1376,7 +1376,7 @@ static ssize_t sector_size_store(struct device *dev,
1376 } else 1376 } else
1377 return -ENXIO; 1377 return -ENXIO;
1378 1378
1379 device_lock(dev); 1379 nd_device_lock(dev);
1380 nvdimm_bus_lock(dev); 1380 nvdimm_bus_lock(dev);
1381 if (to_ndns(dev)->claim) 1381 if (to_ndns(dev)->claim)
1382 rc = -EBUSY; 1382 rc = -EBUSY;
@@ -1387,7 +1387,7 @@ static ssize_t sector_size_store(struct device *dev,
1387 dev_dbg(dev, "result: %zd %s: %s%s", rc, rc < 0 ? "tried" : "wrote", 1387 dev_dbg(dev, "result: %zd %s: %s%s", rc, rc < 0 ? "tried" : "wrote",
1388 buf, buf[len - 1] == '\n' ? "" : "\n"); 1388 buf, buf[len - 1] == '\n' ? "" : "\n");
1389 nvdimm_bus_unlock(dev); 1389 nvdimm_bus_unlock(dev);
1390 device_unlock(dev); 1390 nd_device_unlock(dev);
1391 1391
1392 return rc ? rc : len; 1392 return rc ? rc : len;
1393} 1393}
@@ -1502,9 +1502,9 @@ static ssize_t holder_show(struct device *dev,
1502 struct nd_namespace_common *ndns = to_ndns(dev); 1502 struct nd_namespace_common *ndns = to_ndns(dev);
1503 ssize_t rc; 1503 ssize_t rc;
1504 1504
1505 device_lock(dev); 1505 nd_device_lock(dev);
1506 rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : ""); 1506 rc = sprintf(buf, "%s\n", ndns->claim ? dev_name(ndns->claim) : "");
1507 device_unlock(dev); 1507 nd_device_unlock(dev);
1508 1508
1509 return rc; 1509 return rc;
1510} 1510}
@@ -1541,7 +1541,7 @@ static ssize_t holder_class_store(struct device *dev,
1541 struct nd_region *nd_region = to_nd_region(dev->parent); 1541 struct nd_region *nd_region = to_nd_region(dev->parent);
1542 ssize_t rc; 1542 ssize_t rc;
1543 1543
1544 device_lock(dev); 1544 nd_device_lock(dev);
1545 nvdimm_bus_lock(dev); 1545 nvdimm_bus_lock(dev);
1546 wait_nvdimm_bus_probe_idle(dev); 1546 wait_nvdimm_bus_probe_idle(dev);
1547 rc = __holder_class_store(dev, buf); 1547 rc = __holder_class_store(dev, buf);
@@ -1549,7 +1549,7 @@ static ssize_t holder_class_store(struct device *dev,
1549 rc = nd_namespace_label_update(nd_region, dev); 1549 rc = nd_namespace_label_update(nd_region, dev);
1550 dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc); 1550 dev_dbg(dev, "%s(%zd)\n", rc < 0 ? "fail " : "", rc);
1551 nvdimm_bus_unlock(dev); 1551 nvdimm_bus_unlock(dev);
1552 device_unlock(dev); 1552 nd_device_unlock(dev);
1553 1553
1554 return rc < 0 ? rc : len; 1554 return rc < 0 ? rc : len;
1555} 1555}
@@ -1560,7 +1560,7 @@ static ssize_t holder_class_show(struct device *dev,
1560 struct nd_namespace_common *ndns = to_ndns(dev); 1560 struct nd_namespace_common *ndns = to_ndns(dev);
1561 ssize_t rc; 1561 ssize_t rc;
1562 1562
1563 device_lock(dev); 1563 nd_device_lock(dev);
1564 if (ndns->claim_class == NVDIMM_CCLASS_NONE) 1564 if (ndns->claim_class == NVDIMM_CCLASS_NONE)
1565 rc = sprintf(buf, "\n"); 1565 rc = sprintf(buf, "\n");
1566 else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) || 1566 else if ((ndns->claim_class == NVDIMM_CCLASS_BTT) ||
@@ -1572,7 +1572,7 @@ static ssize_t holder_class_show(struct device *dev,
1572 rc = sprintf(buf, "dax\n"); 1572 rc = sprintf(buf, "dax\n");
1573 else 1573 else
1574 rc = sprintf(buf, "<unknown>\n"); 1574 rc = sprintf(buf, "<unknown>\n");
1575 device_unlock(dev); 1575 nd_device_unlock(dev);
1576 1576
1577 return rc; 1577 return rc;
1578} 1578}
@@ -1586,7 +1586,7 @@ static ssize_t mode_show(struct device *dev,
1586 char *mode; 1586 char *mode;
1587 ssize_t rc; 1587 ssize_t rc;
1588 1588
1589 device_lock(dev); 1589 nd_device_lock(dev);
1590 claim = ndns->claim; 1590 claim = ndns->claim;
1591 if (claim && is_nd_btt(claim)) 1591 if (claim && is_nd_btt(claim))
1592 mode = "safe"; 1592 mode = "safe";
@@ -1599,7 +1599,7 @@ static ssize_t mode_show(struct device *dev,
1599 else 1599 else
1600 mode = "raw"; 1600 mode = "raw";
1601 rc = sprintf(buf, "%s\n", mode); 1601 rc = sprintf(buf, "%s\n", mode);
1602 device_unlock(dev); 1602 nd_device_unlock(dev);
1603 1603
1604 return rc; 1604 return rc;
1605} 1605}
@@ -1703,8 +1703,8 @@ struct nd_namespace_common *nvdimm_namespace_common_probe(struct device *dev)
1703 * Flush any in-progess probes / removals in the driver 1703 * Flush any in-progess probes / removals in the driver
1704 * for the raw personality of this namespace. 1704 * for the raw personality of this namespace.
1705 */ 1705 */
1706 device_lock(&ndns->dev); 1706 nd_device_lock(&ndns->dev);
1707 device_unlock(&ndns->dev); 1707 nd_device_unlock(&ndns->dev);
1708 if (ndns->dev.driver) { 1708 if (ndns->dev.driver) {
1709 dev_dbg(&ndns->dev, "is active, can't bind %s\n", 1709 dev_dbg(&ndns->dev, "is active, can't bind %s\n",
1710 dev_name(dev)); 1710 dev_name(dev));