public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: aspeed-hace: Use device_get_match_data()
@ 2023-10-06 21:39 Rob Herring
  2023-10-09 23:20 ` Andrew Jeffery
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Rob Herring @ 2023-10-06 21:39 UTC (permalink / raw)
  To: Neal Liu, Herbert Xu, David S. Miller, Joel Stanley,
	Andrew Jeffery
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/crypto/aspeed/aspeed-hace.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/crypto/aspeed/aspeed-hace.c b/drivers/crypto/aspeed/aspeed-hace.c
index 8f7aab82e1d8..d9da04fb816e 100644
--- a/drivers/crypto/aspeed/aspeed-hace.c
+++ b/drivers/crypto/aspeed/aspeed-hace.c
@@ -12,11 +12,9 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 #ifdef CONFIG_CRYPTO_DEV_ASPEED_DEBUG
 #define HACE_DBG(d, fmt, ...)	\
@@ -101,7 +99,6 @@ static const struct of_device_id aspeed_hace_of_matches[] = {
 static int aspeed_hace_probe(struct platform_device *pdev)
 {
 	struct aspeed_engine_crypto *crypto_engine;
-	const struct of_device_id *hace_dev_id;
 	struct aspeed_engine_hash *hash_engine;
 	struct aspeed_hace_dev *hace_dev;
 	int rc;
@@ -111,14 +108,13 @@ static int aspeed_hace_probe(struct platform_device *pdev)
 	if (!hace_dev)
 		return -ENOMEM;
 
-	hace_dev_id = of_match_device(aspeed_hace_of_matches, &pdev->dev);
-	if (!hace_dev_id) {
+	hace_dev->version = (uintptr_t)device_get_match_data(&pdev->dev);
+	if (!hace_dev->version) {
 		dev_err(&pdev->dev, "Failed to match hace dev id\n");
 		return -EINVAL;
 	}
 
 	hace_dev->dev = &pdev->dev;
-	hace_dev->version = (unsigned long)hace_dev_id->data;
 	hash_engine = &hace_dev->hash_engine;
 	crypto_engine = &hace_dev->crypto_engine;
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: aspeed-hace: Use device_get_match_data()
  2023-10-06 21:39 [PATCH] crypto: aspeed-hace: Use device_get_match_data() Rob Herring
@ 2023-10-09 23:20 ` Andrew Jeffery
  2023-10-11  3:26 ` Neal Liu
  2023-10-13 10:38 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jeffery @ 2023-10-09 23:20 UTC (permalink / raw)
  To: Rob Herring, Neal Liu, Herbert Xu, David S. Miller, Joel Stanley
  Cc: linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

On Fri, 2023-10-06 at 16:39 -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] crypto: aspeed-hace: Use device_get_match_data()
  2023-10-06 21:39 [PATCH] crypto: aspeed-hace: Use device_get_match_data() Rob Herring
  2023-10-09 23:20 ` Andrew Jeffery
@ 2023-10-11  3:26 ` Neal Liu
  2023-10-13 10:38 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Neal Liu @ 2023-10-11  3:26 UTC (permalink / raw)
  To: Rob Herring, Herbert Xu, David S. Miller, Joel Stanley,
	Andrew Jeffery
  Cc: linux-aspeed@lists.ozlabs.org, linux-crypto@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

> Use preferred device_get_match_data() instead of of_match_device() to get
> the driver match data. With this, adjust the includes to explicitly include the
> correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>

Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] crypto: aspeed-hace: Use device_get_match_data()
  2023-10-06 21:39 [PATCH] crypto: aspeed-hace: Use device_get_match_data() Rob Herring
  2023-10-09 23:20 ` Andrew Jeffery
  2023-10-11  3:26 ` Neal Liu
@ 2023-10-13 10:38 ` Herbert Xu
  2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2023-10-13 10:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: Neal Liu, David S. Miller, Joel Stanley, Andrew Jeffery,
	linux-aspeed, linux-crypto, linux-arm-kernel, linux-kernel

On Fri, Oct 06, 2023 at 04:39:17PM -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/crypto/aspeed/aspeed-hace.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-13 10:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 21:39 [PATCH] crypto: aspeed-hace: Use device_get_match_data() Rob Herring
2023-10-09 23:20 ` Andrew Jeffery
2023-10-11  3:26 ` Neal Liu
2023-10-13 10:38 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox