[PATCH 2/2] libnvdimm: Remove unused nd_attach_ndns

From: linux
Date: Wed Feb 19 2025 - 19:46:11 EST


From: "Dr. David Alan Gilbert" <linux@xxxxxxxxxxx>

nd_attach_ndns() hasn't been used since 2017's
commit 452bae0aede7 ("libnvdimm: fix nvdimm_bus_lock() vs device_lock()
ordering")

Remove it.

Note the __ version is still used and has been left.

Signed-off-by: Dr. David Alan Gilbert <linux@xxxxxxxxxxx>
---
drivers/nvdimm/claim.c | 11 -----------
drivers/nvdimm/nd-core.h | 2 --
2 files changed, 13 deletions(-)

diff --git a/drivers/nvdimm/claim.c b/drivers/nvdimm/claim.c
index 9e84ab411564..51614651d2e7 100644
--- a/drivers/nvdimm/claim.c
+++ b/drivers/nvdimm/claim.c
@@ -56,17 +56,6 @@ bool __nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
return true;
}

-bool nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
- struct nd_namespace_common **_ndns)
-{
- bool claimed;
-
- nvdimm_bus_lock(&attach->dev);
- claimed = __nd_attach_ndns(dev, attach, _ndns);
- nvdimm_bus_unlock(&attach->dev);
- return claimed;
-}
-
static bool is_idle(struct device *dev, struct nd_namespace_common *ndns)
{
struct nd_region *nd_region = to_nd_region(dev->parent);
diff --git a/drivers/nvdimm/nd-core.h b/drivers/nvdimm/nd-core.h
index 2b37b7fc4fef..bfc6bfeb6e24 100644
--- a/drivers/nvdimm/nd-core.h
+++ b/drivers/nvdimm/nd-core.h
@@ -134,8 +134,6 @@ void get_ndd(struct nvdimm_drvdata *ndd);
resource_size_t __nvdimm_namespace_capacity(struct nd_namespace_common *ndns);
void nd_detach_ndns(struct device *dev, struct nd_namespace_common **_ndns);
void __nd_detach_ndns(struct device *dev, struct nd_namespace_common **_ndns);
-bool nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
- struct nd_namespace_common **_ndns);
bool __nd_attach_ndns(struct device *dev, struct nd_namespace_common *attach,
struct nd_namespace_common **_ndns);
ssize_t nd_namespace_store(struct device *dev,
--
2.48.1