[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9b4ea41c-9079-4a49-a598-6ab0b4f885ba@amd.com>
Date: Thu, 6 Nov 2025 14:49:46 -0600
From: Tom Lendacky <thomas.lendacky@....com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Olivia Mackall <olivia@...enic.com>, Herbert Xu
<herbert@...dor.apana.org.au>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>, Ray Jui <rjui@...adcom.com>,
Scott Branden <sbranden@...adcom.com>,
Jesper Nilsson <jesper.nilsson@...s.com>,
Lars Persson <lars.persson@...s.com>, "David S. Miller"
<davem@...emloft.net>, John Allen <john.allen@....com>,
Srujana Challa <schalla@...vell.com>, Bharat Bhushan <bbhushan2@...vell.com>
Cc: linux-crypto@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...s.com
Subject: Re: [PATCH 5/6] crypto: ccp - Simplify with
of_device_get_match_data()
On 11/6/25 10:31, Krzysztof Kozlowski wrote:
> Driver's probe function matches against driver's of_device_id table,
> where each entry has non-NULL match data, so of_match_node() can be
> simplified with of_device_get_match_data().
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
Acked-by: Tom Lendacky <thomas.lendacky@....com>
> ---
> drivers/crypto/ccp/sp-platform.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/crypto/ccp/sp-platform.c b/drivers/crypto/ccp/sp-platform.c
> index de8a8183efdb..3f9843fa7782 100644
> --- a/drivers/crypto/ccp/sp-platform.c
> +++ b/drivers/crypto/ccp/sp-platform.c
> @@ -52,17 +52,6 @@ static const struct of_device_id sp_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, sp_of_match);
>
> -static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev)
> -{
> - const struct of_device_id *match;
> -
> - match = of_match_node(sp_of_match, pdev->dev.of_node);
> - if (match && match->data)
> - return (struct sp_dev_vdata *)match->data;
> -
> - return NULL;
> -}
> -
> static const struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev)
> {
> const struct acpi_device_id *match;
> @@ -123,7 +112,7 @@ static int sp_platform_probe(struct platform_device *pdev)
> goto e_err;
>
> sp->dev_specific = sp_platform;
> - sp->dev_vdata = pdev->dev.of_node ? sp_get_of_version(pdev)
> + sp->dev_vdata = pdev->dev.of_node ? of_device_get_match_data(&pdev->dev)
> : sp_get_acpi_version(pdev);
> if (!sp->dev_vdata) {
> ret = -ENODEV;
>
Powered by blists - more mailing lists