]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: cesa - Simplify with of_device_get_match_data()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Fri, 7 Nov 2025 08:15:53 +0000 (09:15 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 14 Nov 2025 10:15:49 +0000 (18:15 +0800)
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>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/marvell/cesa/cesa.c

index 9c21f5d835d2b0d31e5ba73480440c0dd86adae3..301bdf239e7d6c3d790687511579c823d2db205a 100644 (file)
@@ -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);