Re: [PATCH v3 8/8] coresight: Unify error handling in coresight_register()

From: Leo Yan

Date: Mon Feb 09 2026 - 06:59:38 EST


On Mon, Feb 09, 2026 at 11:28:19AM +0000, Coresight ML wrote:

[...]

> > Probably a better way to clean this up would be to pull out a function for
> > all the stuff that needs to be locked and use guard(). Then do the stuff
> > that doesn't need to be locked after that function. Either way it doesn't
> > look wrong.
>
> If so, although locking is not a concern, the device_register() failures
> still need to release platform data particularly. That means we still
> need extra flag (or returned error) to indicate if it is a
> device_register() failure.
>
> I understand we don't want multiple places for mutex release. It is
> not bad to keep the "registered" flag and drop this patch.

Think again, I found we still need the refactor for the failure
from etm_perf_add_symlink_sink(). This can be unified to call
coresight_unregister() for error handling.

I will send a new series for review.

Thanks,
Leo