This prevents probing of the new cxl_mem driver as the device already has devres entries before probe.
Signed-off-by: Jonathan Cameron jonathan.cameron@huawei.com --- drivers/cxl/core/memdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c index 95d710e80df0..129251ac5bd0 100644 --- a/drivers/cxl/core/memdev.c +++ b/drivers/cxl/core/memdev.c @@ -339,7 +339,7 @@ static bool cdat_hdr_valid(struct cxl_memdev *cxlmd) return check == 0; }
-static int parse_dsmas(struct cxl_memdev *cxlmd) +static int parse_dsmas(struct cxl_memdev *cxlmd, struct device *dev) { struct cxl_dsmas *dsmas_ary = NULL; u32 *data = cxlmd->cdat_table; @@ -405,7 +405,7 @@ static int parse_dsmas(struct cxl_memdev *cxlmd) dev_dbg(&cxlmd->dev, "Found %d DSMAS entries\n", nr_dsmas);
dsmas_byte_size = sizeof(*dsmas_ary) * nr_dsmas; - cxlmd->dsmas_ary = devm_kzalloc(&cxlmd->dev, dsmas_byte_size, GFP_KERNEL); + cxlmd->dsmas_ary = devm_kzalloc(dev, dsmas_byte_size, GFP_KERNEL); if (!cxlmd->dsmas_ary) { rc = -ENOMEM; goto free_dsmas; @@ -437,7 +437,7 @@ struct cxl_memdev *devm_cxl_add_memdev(struct cxl_dev_state *cxlds)
/* Cache the data early to ensure is_visible() works */ if (!cxl_mem_cdat_get_length(cxlds, &cxlmd->cdat_length)) { - cxlmd->cdat_table = devm_kzalloc(dev, cxlmd->cdat_length, GFP_KERNEL); + cxlmd->cdat_table = devm_kzalloc(cxlds->dev, cxlmd->cdat_length, GFP_KERNEL); if (!cxlmd->cdat_table) { rc = -ENOMEM; goto err; @@ -445,7 +445,7 @@ struct cxl_memdev *devm_cxl_add_memdev(struct cxl_dev_state *cxlds) cxl_mem_cdat_read_table(cxlds, cxlmd->cdat_table, cxlmd->cdat_length); }
- rc = parse_dsmas(cxlmd); + rc = parse_dsmas(cxlmd, cxlds->dev); if (rc) dev_err(dev, "No DSMAS data found: %d\n", rc);
linaro-open-discussions@op-lists.linaro.org