diff mbox series

[v5,3/7] lib: sbi: pmu: Remove unnecessary probe function

Message ID 20230515093446.73123-4-ajones@ventanamicro.com
State Superseded
Headers show
Series [v5,1/7] lib: sbi: Introduce register_extensions extension callback | expand

Commit Message

Andrew Jones May 15, 2023, 9:34 a.m. UTC
The absence of a probe implementation means that the extension is
always available. Remove the implementation for the PMU extension,
which does no checking, and indeed even has a comment saying it's
always available.

Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
---
 lib/sbi/sbi_ecall_pmu.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Anup Patel May 15, 2023, 10:27 a.m. UTC | #1
On Mon, May 15, 2023 at 3:04 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>
> The absence of a probe implementation means that the extension is
> always available. Remove the implementation for the PMU extension,
> which does no checking, and indeed even has a comment saying it's
> always available.
>
> Signed-off-by: Andrew Jones <ajones@ventanamicro.com>

Looks good to me.

Reviewed-by: Anup Patel <anup@brainfault.org>

Thanks,
Anup

> ---
>  lib/sbi/sbi_ecall_pmu.c | 8 --------
>  1 file changed, 8 deletions(-)
>
> diff --git a/lib/sbi/sbi_ecall_pmu.c b/lib/sbi/sbi_ecall_pmu.c
> index b0589d0ecfa1..1d5d512eeed7 100644
> --- a/lib/sbi/sbi_ecall_pmu.c
> +++ b/lib/sbi/sbi_ecall_pmu.c
> @@ -81,13 +81,6 @@ static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
>         return ret;
>  }
>
> -static int sbi_ecall_pmu_probe(unsigned long extid, unsigned long *out_val)
> -{
> -       /* PMU extension is always enabled */
> -       *out_val = 1;
> -       return 0;
> -}
> -
>  struct sbi_ecall_extension ecall_pmu;
>
>  static int sbi_ecall_pmu_register_extensions(void)
> @@ -99,6 +92,5 @@ struct sbi_ecall_extension ecall_pmu = {
>         .extid_start            = SBI_EXT_PMU,
>         .extid_end              = SBI_EXT_PMU,
>         .register_extensions    = sbi_ecall_pmu_register_extensions,
> -       .probe                  = sbi_ecall_pmu_probe,
>         .handle                 = sbi_ecall_pmu_handler,
>  };
> --
> 2.40.0
>
diff mbox series

Patch

diff --git a/lib/sbi/sbi_ecall_pmu.c b/lib/sbi/sbi_ecall_pmu.c
index b0589d0ecfa1..1d5d512eeed7 100644
--- a/lib/sbi/sbi_ecall_pmu.c
+++ b/lib/sbi/sbi_ecall_pmu.c
@@ -81,13 +81,6 @@  static int sbi_ecall_pmu_handler(unsigned long extid, unsigned long funcid,
 	return ret;
 }
 
-static int sbi_ecall_pmu_probe(unsigned long extid, unsigned long *out_val)
-{
-	/* PMU extension is always enabled */
-	*out_val = 1;
-	return 0;
-}
-
 struct sbi_ecall_extension ecall_pmu;
 
 static int sbi_ecall_pmu_register_extensions(void)
@@ -99,6 +92,5 @@  struct sbi_ecall_extension ecall_pmu = {
 	.extid_start		= SBI_EXT_PMU,
 	.extid_end		= SBI_EXT_PMU,
 	.register_extensions	= sbi_ecall_pmu_register_extensions,
-	.probe			= sbi_ecall_pmu_probe,
 	.handle			= sbi_ecall_pmu_handler,
 };