[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251217154830.00001085@huawei.com>
Date: Wed, 17 Dec 2025 15:48:30 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: Dan Williams <dan.j.williams@...el.com>
CC: <dave.jiang@...el.com>, <linux-cxl@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <Smita.KoralahalliChannabasappa@....com>,
<alison.schofield@...el.com>, <terry.bowman@....com>,
<alejandro.lucero-palau@....com>, <linux-pci@...r.kernel.org>, Ben Cheatham
<benjamin.cheatham@....com>, Alejandro Lucero <alucerop@....com>
Subject: Re: [PATCH v2 4/6] cxl/mem: Convert devm_cxl_add_memdev() to
scope-based-cleanup
On Mon, 15 Dec 2025 16:56:14 -0800
Dan Williams <dan.j.williams@...el.com> wrote:
> In preparation for adding more setup steps, convert the current
> implementation to scope-based cleanup.
>
> The cxl_memdev_shutdown() is only required after cdev_device_add(). With
> that moved to a helper function it precludes the need to add
> scope-based-handler for that cleanup if devm_add_action_or_reset() fails.
>
> Cc: Smita Koralahalli <Smita.KoralahalliChannabasappa@....com>
> Reviewed-by: Alison Schofield <alison.schofield@...el.com>
> Reviewed-by: Dave Jiang <dave.jiang@...el.com>
> Reviewed-by: Ben Cheatham <benjamin.cheatham@....com>
> Tested-by: Alejandro Lucero <alucerop@....com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
One trivial thing below that is probably fine to cleanup whilst picking this
up.
Reviewed-by: Jonathan Cameron <jonathan.cameron@...wei.com>
> ---
> drivers/cxl/core/memdev.c | 70 ++++++++++++++++++++++++---------------
> 1 file changed, 44 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/cxl/core/memdev.c b/drivers/cxl/core/memdev.c
> index 7a4153e1c6a7..18efbf294db5 100644
> --- a/drivers/cxl/core/memdev.c
> +++ b/drivers/cxl/core/memdev.c
> +
> +DEFINE_FREE(put_cxlmd, struct cxl_memdev *,
> + if (!IS_ERR_OR_NULL(_T)) put_device(&_T->dev);)
Bonus ; ?
Powered by blists - more mailing lists