On 17/12/25 03:38PM, Jonathan Cameron wrote:
On Wed, 19 Nov 2025 13:22:52 +0530
Neeraj Kumar <[email protected]> wrote:
As pmem region label update/delete has hard dependency on libnvdimm.
It is therefore put core/pmem_region.c under CONFIG_CXL_PMEM_REGION
control. It handles the dependency by selecting CONFIG_LIBNVDIMM
if not enabled.
Signed-off-by: Neeraj Kumar <[email protected]>
diff --git a/drivers/cxl/core/core.h b/drivers/cxl/core/core.h
index 5ebbc3d3dde5..beeb9b7527b8 100644
--- a/drivers/cxl/core/core.h
+++ b/drivers/cxl/core/core.h
@@ -89,17 +88,23 @@ static inline struct cxl_region *to_cxl_region(struct
device *dev)
{
return NULL;
}
-static inline int devm_cxl_add_pmem_region(struct cxl_region *cxlr)
-{
- return 0;
-}
diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
index 9798120b208e..408e139718f1 100644
--- a/drivers/cxl/core/region.c
+++ b/drivers/cxl/core/region.c
@@ -3918,6 +3918,8 @@ static int cxl_region_probe(struct device *dev)
dev_dbg(&cxlr->dev, "CXL EDAC registration for region_id=%d
failed\n",
cxlr->id);
+ if (!IS_ENABLED(CONFIG_CXL_PMEM_REGION))
+ return -EINVAL;
return devm_cxl_add_pmem_region(cxlr);
Why not have the stub return -EINVAL if it never makes sense to call without
the CONFIG being enabled?
I have removed this config check and handled it in
devm_cxl_add_pmem_region() itself.
Regards,
Neeraj