Linux CXL
 help / color / mirror / Atom feed
From: Dave Jiang <dave.jiang@intel.com>
To: linux-cxl@vger.kernel.org
Cc: djbw@kernel.org, kernel test robot <lkp@intel.com>
Subject: [PATCH] cxl: Add dummy function for cxl_memdev_attach_region for !CONFIG_CXL_REGION
Date: Tue,  9 Jun 2026 17:13:24 -0700	[thread overview]
Message-ID: <20260610001324.260268-1-dave.jiang@intel.com> (raw)

Add a dummy function that returns -EOPNOTSUPP for cxl_memdev_attach_region
when CONFIG_CXL_REGION is not enabled. This allow sbuilding when
cxl/core/region.o isn't built.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 9b1e70e8f9ec ("cxl/region: Introduce devm_cxl_probe_mem()")
https://lore.kernel.org/oe-kbuild-all/202606100401.GOjzpKHo-lkp@intel.com/
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---

Fix is against last patch of Dan's [1] series for Introduce
devm_cxl_probe_mem() and fix region deletion.

[1]: https://lore.kernel.org/linux-cxl/48834616-6e75-4936-89be-9224a6dedefa@intel.com/T/#t
---
 drivers/cxl/cxlmem.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/cxl/cxlmem.h b/drivers/cxl/cxlmem.h
index d3bdd00f94b3..ed419d0c59f2 100644
--- a/drivers/cxl/cxlmem.h
+++ b/drivers/cxl/cxlmem.h
@@ -115,7 +115,14 @@ struct cxl_attach_region {
 	struct range hpa_range;
 };
 
+#ifdef CONFIG_CXL_REGION
 int cxl_memdev_attach_region(struct cxl_memdev *cxlmd);
+#else
+static inline int cxl_memdev_attach_region(struct cxl_memdev *cxlmd)
+{
+	return -EOPNOTSUPP;
+}
+#endif
 
 struct cxl_memdev *devm_cxl_add_classdev(struct cxl_dev_state *cxlds);
 struct cxl_memdev *__devm_cxl_add_memdev(struct cxl_dev_state *cxlds,

base-commit: 9b1e70e8f9ec4b5c6ce7fa774a0023bb6894c686
-- 
2.54.0


             reply	other threads:[~2026-06-10  0:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10  0:13 Dave Jiang [this message]
2026-06-10 17:25 ` [PATCH] cxl: Add dummy function for cxl_memdev_attach_region for !CONFIG_CXL_REGION Alison Schofield
2026-06-12 20:18 ` Dan Williams (nvidia)
2026-06-12 20:52 ` Dave Jiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260610001324.260268-1-dave.jiang@intel.com \
    --to=dave.jiang@intel.com \
    --cc=djbw@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=lkp@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox