linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Olivia Mackall <olivia@selenic.com>,
	 Herbert Xu <herbert@gondor.apana.org.au>,
	 Florian Fainelli <florian.fainelli@broadcom.com>,
	 Broadcom internal kernel review list
	<bcm-kernel-feedback-list@broadcom.com>,
	 Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	 Jesper Nilsson <jesper.nilsson@axis.com>,
	 Lars Persson <lars.persson@axis.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 Tom Lendacky <thomas.lendacky@amd.com>,
	John Allen <john.allen@amd.com>,
	 Srujana Challa <schalla@marvell.com>,
	 Bharat Bhushan <bbhushan2@marvell.com>
Cc: linux-crypto@vger.kernel.org,
	linux-rpi-kernel@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,  linux-arm-kernel@axis.com,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: [PATCH v2 6/6] crypto: cesa - Simplify with of_device_get_match_data()
Date: Fri, 07 Nov 2025 09:15:53 +0100	[thread overview]
Message-ID: <20251107-crypto-of-match-v2-6-a0ea93e24d2a@linaro.org> (raw)
In-Reply-To: <20251107-crypto-of-match-v2-0-a0ea93e24d2a@linaro.org>

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@linaro.org>
---
 drivers/crypto/marvell/cesa/cesa.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
index 9c21f5d835d2..301bdf239e7d 100644
--- a/drivers/crypto/marvell/cesa/cesa.c
+++ b/drivers/crypto/marvell/cesa/cesa.c
@@ -420,7 +420,6 @@ static int mv_cesa_probe(struct platform_device *pdev)
 {
 	const struct mv_cesa_caps *caps = &orion_caps;
 	const struct mbus_dram_target_info *dram;
-	const struct of_device_id *match;
 	struct device *dev = &pdev->dev;
 	struct mv_cesa_dev *cesa;
 	struct mv_cesa_engine *engines;
@@ -433,11 +432,9 @@ static int mv_cesa_probe(struct platform_device *pdev)
 	}
 
 	if (dev->of_node) {
-		match = of_match_node(mv_cesa_of_match_table, dev->of_node);
-		if (!match || !match->data)
+		caps = of_device_get_match_data(dev);
+		if (!caps)
 			return -ENOTSUPP;
-
-		caps = match->data;
 	}
 
 	cesa = devm_kzalloc(dev, sizeof(*cesa), GFP_KERNEL);

-- 
2.48.1



  parent reply	other threads:[~2025-11-07  8:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  8:15 [PATCH v2 0/6] crypto/hwrng: Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-07  8:15 ` [PATCH v2 1/6] hwrng: bcm2835 - Move MODULE_DEVICE_TABLE() to table definition Krzysztof Kozlowski
2025-11-07  8:15 ` [PATCH v2 2/6] hwrng: bcm2835 - Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-07  8:15 ` [PATCH v2 3/6] crypto: artpec6 " Krzysztof Kozlowski
2025-11-07  9:39   ` Jesper Nilsson
2025-11-07  8:15 ` [PATCH v2 4/6] crypto: ccp - Constify 'dev_vdata' member Krzysztof Kozlowski
2025-11-07  8:15 ` [PATCH v2 5/6] crypto: ccp - Simplify with of_device_get_match_data() Krzysztof Kozlowski
2025-11-07  8:15 ` Krzysztof Kozlowski [this message]
2025-11-14 10:22 ` [PATCH v2 0/6] crypto/hwrng: " Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251107-crypto-of-match-v2-6-a0ea93e24d2a@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=bbhushan2@marvell.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=florian.fainelli@broadcom.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=jesper.nilsson@axis.com \
    --cc=john.allen@amd.com \
    --cc=lars.persson@axis.com \
    --cc=linux-arm-kernel@axis.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=olivia@selenic.com \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.com \
    --cc=schalla@marvell.com \
    --cc=thomas.lendacky@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).