cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko
Moving the symbol devm_cxl_add_nvdimm_bridge() to drivers/cxl/cxl_pmem.c, so that cxl_pmem can export a symbol that gives cxl_acpi a depedency on cxl_pmem kernel module. This is a prepatory patch to resolve the issue of a race for nvdimm_bus object that is created during cxl_acpi_probe(). No functional changes besides moving code. Suggested-by: Dan Williams <dan.j.williams@intel.com> Acked-by: Ira Weiny <ira.weiny@intel.com> Tested-by: Alison Schofield <alison.schofield@intel.com> Reviewed-by: Alison Schofield <alison.schofield@intel.com?> Link: https://patch.msgid.link/20260205001633.1813643-2-dave.jiang@intel.com Signed-off-by: Dave Jiang <dave.jiang@intel.com>
This commit is contained in:
parent
0066688dbc
commit
e7e222ad73
|
|
@ -115,15 +115,8 @@ static void unregister_nvb(void *_cxl_nvb)
|
|||
device_unregister(&cxl_nvb->dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
|
||||
* @host: platform firmware root device
|
||||
* @port: CXL port at the root of a CXL topology
|
||||
*
|
||||
* Return: bridge device that can host cxl_nvdimm objects
|
||||
*/
|
||||
struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
|
||||
struct cxl_port *port)
|
||||
struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
|
||||
struct cxl_port *port)
|
||||
{
|
||||
struct cxl_nvdimm_bridge *cxl_nvb;
|
||||
struct device *dev;
|
||||
|
|
@ -155,7 +148,7 @@ err:
|
|||
put_device(dev);
|
||||
return ERR_PTR(rc);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
|
||||
EXPORT_SYMBOL_FOR_MODULES(__devm_cxl_add_nvdimm_bridge, "cxl_pmem");
|
||||
|
||||
static void cxl_nvdimm_release(struct device *dev)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -920,6 +920,8 @@ void cxl_driver_unregister(struct cxl_driver *cxl_drv);
|
|||
struct cxl_nvdimm_bridge *to_cxl_nvdimm_bridge(struct device *dev);
|
||||
struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
|
||||
struct cxl_port *port);
|
||||
struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
|
||||
struct cxl_port *port);
|
||||
struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev);
|
||||
bool is_cxl_nvdimm(struct device *dev);
|
||||
int devm_cxl_add_nvdimm(struct device *host, struct cxl_port *port,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,20 @@
|
|||
|
||||
static __read_mostly DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
|
||||
|
||||
/**
|
||||
* __devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
|
||||
* @host: platform firmware root device
|
||||
* @port: CXL port at the root of a CXL topology
|
||||
*
|
||||
* Return: bridge device that can host cxl_nvdimm objects
|
||||
*/
|
||||
struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
|
||||
struct cxl_port *port)
|
||||
{
|
||||
return __devm_cxl_add_nvdimm_bridge(host, port);
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
|
||||
|
||||
static void clear_exclusive(void *mds)
|
||||
{
|
||||
clear_exclusive_cxl_commands(mds, exclusive_cmds);
|
||||
|
|
|
|||
Loading…
Reference in New Issue