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

crypto: picoxcell - Remove spacc_is_compatible() wrapper function

The function is used to check either the platform device ID name or the OF
node's compatible (depending how the device was registered) to know which
device type was registered.

But the driver is for a DT-only platform and so there's no need for this
level of indirection since the devices can only be registered via OF.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Javier Martinez Canillas and committed by
Herbert Xu
012ef703 6b2be1dd

+3 -18
+3 -18
drivers/crypto/picoxcell_crypto.c
··· 1616 1616 MODULE_DEVICE_TABLE(of, spacc_of_id_table); 1617 1617 #endif /* CONFIG_OF */ 1618 1618 1619 - static bool spacc_is_compatible(struct platform_device *pdev, 1620 - const char *spacc_type) 1621 - { 1622 - const struct platform_device_id *platid = platform_get_device_id(pdev); 1623 - 1624 - if (platid && !strcmp(platid->name, spacc_type)) 1625 - return true; 1626 - 1627 - #ifdef CONFIG_OF 1628 - if (of_device_is_compatible(pdev->dev.of_node, spacc_type)) 1629 - return true; 1630 - #endif /* CONFIG_OF */ 1631 - 1632 - return false; 1633 - } 1634 - 1635 1619 static int spacc_probe(struct platform_device *pdev) 1636 1620 { 1637 1621 int i, err, ret = -EINVAL; 1638 1622 struct resource *mem, *irq; 1623 + struct device_node *np = pdev->dev.of_node; 1639 1624 struct spacc_engine *engine = devm_kzalloc(&pdev->dev, sizeof(*engine), 1640 1625 GFP_KERNEL); 1641 1626 if (!engine) 1642 1627 return -ENOMEM; 1643 1628 1644 - if (spacc_is_compatible(pdev, "picochip,spacc-ipsec")) { 1629 + if (of_device_is_compatible(np, "picochip,spacc-ipsec")) { 1645 1630 engine->max_ctxs = SPACC_CRYPTO_IPSEC_MAX_CTXS; 1646 1631 engine->cipher_pg_sz = SPACC_CRYPTO_IPSEC_CIPHER_PG_SZ; 1647 1632 engine->hash_pg_sz = SPACC_CRYPTO_IPSEC_HASH_PG_SZ; ··· 1635 1650 engine->num_algs = ARRAY_SIZE(ipsec_engine_algs); 1636 1651 engine->aeads = ipsec_engine_aeads; 1637 1652 engine->num_aeads = ARRAY_SIZE(ipsec_engine_aeads); 1638 - } else if (spacc_is_compatible(pdev, "picochip,spacc-l2")) { 1653 + } else if (of_device_is_compatible(np, "picochip,spacc-l2")) { 1639 1654 engine->max_ctxs = SPACC_CRYPTO_L2_MAX_CTXS; 1640 1655 engine->cipher_pg_sz = SPACC_CRYPTO_L2_CIPHER_PG_SZ; 1641 1656 engine->hash_pg_sz = SPACC_CRYPTO_L2_HASH_PG_SZ;