Re: [PATCH] auxdisplay: cfag12864bfb: Fix init cleanup and simplify error paths

From: Andy Shevchenko

Date: Tue Nov 17 2026 - 05:34:03 EST


On Tue, Nov 17, 2026 at 06:27:28PM +0800, Haoxiang Li wrote:
> If initialization fails after cfag12864b_enable() succeeds, LCD
> refreshing remains enabled. A subsequent attempt to load the
> framebuffer module can fail because refreshing is still marked
> as in use.
>
> Flatten the initialization flow and introduce cleanup labels to
> release resources in reverse order. Call cfag12864b_disable() on
> failures after refreshing has been enabled.

Can't you use platform_device_register_full()?

--
With Best Regards,
Andy Shevchenko