diff mbox series

perf: arm-ni: Fix missing platform_set_drvdata()

Message ID 20250401054248.3985814-1-andy.xu@hj-micro.com (mailing list archive)
State New
Headers show
Series perf: arm-ni: Fix missing platform_set_drvdata() | expand

Commit Message

Hongbo Yao April 1, 2025, 5:42 a.m. UTC
Add missing platform_set_drvdata in arm_ni_probe(), otherwise
calling platform_get_drvdata() in remove returns NULL.

Fixes: 4d5a7680f2b4 ("perf: Add driver for Arm NI-700 interconnect PMU")
Signed-off-by: Hongbo Yao <andy.xu@hj-micro.com>
---
 drivers/perf/arm-ni.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Robin Murphy April 1, 2025, 2:04 p.m. UTC | #1
On 2025-04-01 6:42 am, Hongbo Yao wrote:
> Add missing platform_set_drvdata in arm_ni_probe(), otherwise
> calling platform_get_drvdata() in remove returns NULL.

Oops, indeed. Not sure how that got lost...

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

> Fixes: 4d5a7680f2b4 ("perf: Add driver for Arm NI-700 interconnect PMU")
> Signed-off-by: Hongbo Yao <andy.xu@hj-micro.com>
> ---
>   drivers/perf/arm-ni.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c
> index ee85577e86b9..da1907b7391d 100644
> --- a/drivers/perf/arm-ni.c
> +++ b/drivers/perf/arm-ni.c
> @@ -666,6 +666,7 @@ static int arm_ni_probe(struct platform_device *pdev)
>   	ni->num_cds = num_cds;
>   	ni->part = part;
>   	ni->id = atomic_fetch_inc(&id);
> +	platform_set_drvdata(pdev, ni);
>   
>   	for (int v = 0; v < cfg.num_components; v++) {
>   		reg = readl_relaxed(cfg.base + NI_CHILD_PTR(v));
diff mbox series

Patch

diff --git a/drivers/perf/arm-ni.c b/drivers/perf/arm-ni.c
index ee85577e86b9..da1907b7391d 100644
--- a/drivers/perf/arm-ni.c
+++ b/drivers/perf/arm-ni.c
@@ -666,6 +666,7 @@  static int arm_ni_probe(struct platform_device *pdev)
 	ni->num_cds = num_cds;
 	ni->part = part;
 	ni->id = atomic_fetch_inc(&id);
+	platform_set_drvdata(pdev, ni);
 
 	for (int v = 0; v < cfg.num_components; v++) {
 		reg = readl_relaxed(cfg.base + NI_CHILD_PTR(v));