Re: [PATCH 4/6] cxl/mem: Convert devm_cxl_add_memdev() to scope-based-cleanup
From: Alison Schofield
Date: Thu Dec 04 2025 - 22:37:49 EST
On Wed, Dec 03, 2025 at 06:21:34PM -0800, Dan Williams 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@xxxxxxx>
> Cc: Alejandro Lucero <alucerop@xxxxxxx>
> Signed-off-by: Dan Williams <dan.j.williams@xxxxxxxxx>
Reviewed-by: Alison Schofield <alison.schofield@xxxxxxxxx>