diff mbox series

[2/4] firmware: tegra: switch to global mrq_is_supported()

Message ID 1539758250-7380-3-git-send-email-talho@nvidia.com
State Superseded
Headers show
Series BPMP-FW version query ("tag") update | expand

Commit Message

Timo Alho Oct. 17, 2018, 6:37 a.m. UTC
Patch "firmware: tegra: add helper to check for supported MRQs" added
an API to check if MRQ is supported. Remove the implementation from
bpmp debugfs code in favor of that.

Signed-off-by: Timo Alho <talho@nvidia.com>
---
 drivers/firmware/tegra/bpmp-debugfs.c | 29 +----------------------------
 1 file changed, 1 insertion(+), 28 deletions(-)

Comments

Jon Hunter Oct. 17, 2018, 9:17 a.m. UTC | #1
On 17/10/2018 07:37, Timo Alho wrote:
> Patch "firmware: tegra: add helper to check for supported MRQs" added
> an API to check if MRQ is supported. Remove the implementation from
> bpmp debugfs code in favor of that.
> 
> Signed-off-by: Timo Alho <talho@nvidia.com>
> ---
>  drivers/firmware/tegra/bpmp-debugfs.c | 29 +----------------------------
>  1 file changed, 1 insertion(+), 28 deletions(-)
> 
> diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
> index f7f6a0a..a84df1a 100644
> --- a/drivers/firmware/tegra/bpmp-debugfs.c
> +++ b/drivers/firmware/tegra/bpmp-debugfs.c
> @@ -379,33 +379,6 @@ static int create_debugfs_mirror(struct tegra_bpmp *bpmp, void *buf,
>  	return err;
>  }
>  
> -static int mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq)
> -{
> -	struct mrq_query_abi_request req = { .mrq = cpu_to_le32(mrq) };
> -	struct mrq_query_abi_response resp;
> -	struct tegra_bpmp_message msg = {
> -		.mrq = MRQ_QUERY_ABI,
> -		.tx = {
> -			.data = &req,
> -			.size = sizeof(req),
> -		},
> -		.rx = {
> -			.data = &resp,
> -			.size = sizeof(resp),
> -		},
> -	};
> -	int ret;
> -
> -	ret = tegra_bpmp_transfer(bpmp, &msg);
> -	if (ret < 0) {
> -		/* something went wrong; assume not supported */
> -		dev_warn(bpmp->dev, "tegra_bpmp_transfer failed (%d)\n", ret);
> -		return 0;
> -	}
> -
> -	return resp.status ? 0 : 1;
> -}
> -
>  int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
>  {
>  	dma_addr_t phys;
> @@ -415,7 +388,7 @@ int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
>  	int ret;
>  	struct dentry *root;
>  
> -	if (!mrq_is_supported(bpmp, MRQ_DEBUGFS))
> +	if (!tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))
>  		return 0;
>  
>  	root = debugfs_create_dir("bpmp", NULL);
> 

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers,
Jon
diff mbox series

Patch

diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
index f7f6a0a..a84df1a 100644
--- a/drivers/firmware/tegra/bpmp-debugfs.c
+++ b/drivers/firmware/tegra/bpmp-debugfs.c
@@ -379,33 +379,6 @@  static int create_debugfs_mirror(struct tegra_bpmp *bpmp, void *buf,
 	return err;
 }
 
-static int mrq_is_supported(struct tegra_bpmp *bpmp, unsigned int mrq)
-{
-	struct mrq_query_abi_request req = { .mrq = cpu_to_le32(mrq) };
-	struct mrq_query_abi_response resp;
-	struct tegra_bpmp_message msg = {
-		.mrq = MRQ_QUERY_ABI,
-		.tx = {
-			.data = &req,
-			.size = sizeof(req),
-		},
-		.rx = {
-			.data = &resp,
-			.size = sizeof(resp),
-		},
-	};
-	int ret;
-
-	ret = tegra_bpmp_transfer(bpmp, &msg);
-	if (ret < 0) {
-		/* something went wrong; assume not supported */
-		dev_warn(bpmp->dev, "tegra_bpmp_transfer failed (%d)\n", ret);
-		return 0;
-	}
-
-	return resp.status ? 0 : 1;
-}
-
 int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
 {
 	dma_addr_t phys;
@@ -415,7 +388,7 @@  int tegra_bpmp_init_debugfs(struct tegra_bpmp *bpmp)
 	int ret;
 	struct dentry *root;
 
-	if (!mrq_is_supported(bpmp, MRQ_DEBUGFS))
+	if (!tegra_bpmp_mrq_is_supported(bpmp, MRQ_DEBUGFS))
 		return 0;
 
 	root = debugfs_create_dir("bpmp", NULL);