[PATCH v5 2/3] coresight: Reorder coresight_device_release to match coresight_register

Sean Anderson posted 3 patches 4 months, 2 weeks ago
[PATCH v5 2/3] coresight: Reorder coresight_device_release to match coresight_register
Posted by Sean Anderson 4 months, 2 weeks ago
To make it easier to determine where to add new release actions, reorder
the actions in coresight_device_release to be the reverse of
coresight_register.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---

Changes in v5:
- New

 drivers/hwtracing/coresight/coresight-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
index 022c8384b98d..305b1773cfbe 100644
--- a/drivers/hwtracing/coresight/coresight-core.c
+++ b/drivers/hwtracing/coresight/coresight-core.c
@@ -1046,8 +1046,8 @@ static void coresight_device_release(struct device *dev)
 {
 	struct coresight_device *csdev = to_coresight_device(dev);
 
-	fwnode_handle_put(csdev->dev.fwnode);
 	free_percpu(csdev->perf_sink_id_map.cpu_map);
+	fwnode_handle_put(csdev->dev.fwnode);
 	kfree(csdev);
 }
 
-- 
2.35.1.1320.gc452695387.dirty
Re: [PATCH v5 2/3] coresight: Reorder coresight_device_release to match coresight_register
Posted by Mike Leach 4 months, 2 weeks ago
On Thu, 25 Sept 2025 at 16:04, Sean Anderson <sean.anderson@linux.dev> wrote:
>
> To make it easier to determine where to add new release actions, reorder
> the actions in coresight_device_release to be the reverse of
> coresight_register.
>
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> ---
>
> Changes in v5:
> - New
>
>  drivers/hwtracing/coresight/coresight-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index 022c8384b98d..305b1773cfbe 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1046,8 +1046,8 @@ static void coresight_device_release(struct device *dev)
>  {
>         struct coresight_device *csdev = to_coresight_device(dev);
>
> -       fwnode_handle_put(csdev->dev.fwnode);
>         free_percpu(csdev->perf_sink_id_map.cpu_map);
> +       fwnode_handle_put(csdev->dev.fwnode);
>         kfree(csdev);
>  }
>
> --
> 2.35.1.1320.gc452695387.dirty
>

Reviewed-by: Mike Leach <mike.leach@linaro.org>

-- 
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK