Subject: Re: [PATCH v18 07/20] sfc: create type2 cxl memdev

From: Jonathan Cameron <[email-masked]>
Date: Thu, 18 Sep 2025 12:08:35 +0100

On Thu, 18 Sep 2025 10:17:33 +0100
[email-masked] wrote:

> From: Alejandro Lucero <[email-masked]>
> 
> Use cxl API for creating a cxl memory device using the type2
> cxl_dev_state struct.
> 
> Signed-off-by: Alejandro Lucero <[email-masked]>
> Reviewed-by: Martin Habets <[email-masked]>
> Reviewed-by: Fan Ni <[email-masked]>
> Acked-by: Edward Cree <[email-masked]>
> Reviewed-by: Jonathan Cameron <[email-masked]>
> ---
>  drivers/net/ethernet/sfc/efx_cxl.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/net/ethernet/sfc/efx_cxl.c b/drivers/net/ethernet/sfc/efx_cxl.c
> index 651d26aa68dc..177c60b269d6 100644
> --- a/drivers/net/ethernet/sfc/efx_cxl.c
> +++ b/drivers/net/ethernet/sfc/efx_cxl.c
> @@ -82,6 +82,12 @@ int efx_cxl_init(struct efx_probe_data *probe_data)
>  		return dev_err_probe(&pci_dev->dev, -ENODEV,
>  				     "dpa capacity setup failed\n");
>  
> +	cxl->cxlmd = devm_cxl_add_memdev(&pci_dev->dev, &cxl->cxlds, NULL);
> +	if (IS_ERR(cxl->cxlmd)) {
> +		pci_err(pci_dev, "CXL accel memdev creation failed");

Throwing a pci_err() in here seems to be a further bit of inconsistency.

> +		return PTR_ERR(cxl->cxlmd);
> +	}
> +
>  	probe_data->cxl = cxl;
>  
>  	return 0;