Skip to content

Commit 054c7f7

Browse files
krzkherbertx
authored andcommitted
crypto: cesa - Simplify with of_device_get_match_data()
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>
1 parent 4ae946a commit 054c7f7

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

  • drivers/crypto/marvell/cesa

drivers/crypto/marvell/cesa/cesa.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ static int mv_cesa_probe(struct platform_device *pdev)
420420
{
421421
const struct mv_cesa_caps *caps = &orion_caps;
422422
const struct mbus_dram_target_info *dram;
423-
const struct of_device_id *match;
424423
struct device *dev = &pdev->dev;
425424
struct mv_cesa_dev *cesa;
426425
struct mv_cesa_engine *engines;
@@ -433,11 +432,9 @@ static int mv_cesa_probe(struct platform_device *pdev)
433432
}
434433

435434
if (dev->of_node) {
436-
match = of_match_node(mv_cesa_of_match_table, dev->of_node);
437-
if (!match || !match->data)
435+
caps = of_device_get_match_data(dev);
436+
if (!caps)
438437
return -ENOTSUPP;
439-
440-
caps = match->data;
441438
}
442439

443440
cesa = devm_kzalloc(dev, sizeof(*cesa), GFP_KERNEL);

0 commit comments

Comments
 (0)