Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: ccp - 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().

Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Krzysztof Kozlowski and committed by
Herbert Xu
4ae946a4 ec2054c1

+1 -12
+1 -12
drivers/crypto/ccp/sp-platform.c
··· 52 52 }; 53 53 MODULE_DEVICE_TABLE(of, sp_of_match); 54 54 55 - static struct sp_dev_vdata *sp_get_of_version(struct platform_device *pdev) 56 - { 57 - const struct of_device_id *match; 58 - 59 - match = of_match_node(sp_of_match, pdev->dev.of_node); 60 - if (match && match->data) 61 - return (struct sp_dev_vdata *)match->data; 62 - 63 - return NULL; 64 - } 65 - 66 55 static const struct sp_dev_vdata *sp_get_acpi_version(struct platform_device *pdev) 67 56 { 68 57 const struct acpi_device_id *match; ··· 112 123 goto e_err; 113 124 114 125 sp->dev_specific = sp_platform; 115 - sp->dev_vdata = pdev->dev.of_node ? sp_get_of_version(pdev) 126 + sp->dev_vdata = pdev->dev.of_node ? of_device_get_match_data(&pdev->dev) 116 127 : sp_get_acpi_version(pdev); 117 128 if (!sp->dev_vdata) { 118 129 ret = -ENODEV;