diff options
Diffstat (limited to 'drivers/crypto/amcc/crypto4xx_core.c')
| -rw-r--r-- | drivers/crypto/amcc/crypto4xx_core.c | 30 | 
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 2b1baee525b..37f9cc98ba1 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -27,6 +27,9 @@  #include <linux/dma-mapping.h>  #include <linux/platform_device.h>  #include <linux/init.h> +#include <linux/module.h> +#include <linux/of_address.h> +#include <linux/of_irq.h>  #include <linux/of_platform.h>  #include <linux/slab.h>  #include <asm/dcr.h> @@ -51,6 +54,7 @@ static void crypto4xx_hw_init(struct crypto4xx_device *dev)  	union ce_io_threshold io_threshold;  	u32 rand_num;  	union ce_pe_dma_cfg pe_dma_cfg; +	u32 device_ctrl;  	writel(PPC4XX_BYTE_ORDER, dev->ce_base + CRYPTO4XX_BYTE_ORDER_CFG);  	/* setup pe dma, include reset sg, pdr and pe, then release reset */ @@ -84,7 +88,9 @@ static void crypto4xx_hw_init(struct crypto4xx_device *dev)  	writel(ring_size.w, dev->ce_base + CRYPTO4XX_RING_SIZE);  	ring_ctrl.w = 0;  	writel(ring_ctrl.w, dev->ce_base + CRYPTO4XX_RING_CTRL); -	writel(PPC4XX_DC_3DES_EN, dev->ce_base + CRYPTO4XX_DEVICE_CTRL); +	device_ctrl = readl(dev->ce_base + CRYPTO4XX_DEVICE_CTRL); +	device_ctrl |= PPC4XX_DC_3DES_EN; +	writel(device_ctrl, dev->ce_base + CRYPTO4XX_DEVICE_CTRL);  	writel(dev->gdr_pa, dev->ce_base + CRYPTO4XX_GATH_RING_BASE);  	writel(dev->sdr_pa, dev->ce_base + CRYPTO4XX_SCAT_RING_BASE);  	part_ring_size.w = 0; @@ -718,7 +724,6 @@ static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)  	crypto4xx_destroy_pdr(core_dev->dev);  	crypto4xx_destroy_gdr(core_dev->dev);  	crypto4xx_destroy_sdr(core_dev->dev); -	dev_set_drvdata(core_dev->device, NULL);  	iounmap(core_dev->dev->ce_base);  	kfree(core_dev->dev);  	kfree(core_dev); @@ -1150,8 +1155,7 @@ struct crypto4xx_alg_common crypto4xx_alg[] = {  /**   * Module Initialization Routine   */ -static int __init crypto4xx_probe(struct platform_device *ofdev, -				  const struct of_device_id *match) +static int __init crypto4xx_probe(struct platform_device *ofdev)  {  	int rc;  	struct resource res; @@ -1224,6 +1228,7 @@ static int __init crypto4xx_probe(struct platform_device *ofdev,  	core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);  	if (!core_dev->dev->ce_base) {  		dev_err(dev, "failed to of_iomap\n"); +		rc = -ENOMEM;  		goto err_iomap;  	} @@ -1242,9 +1247,9 @@ err_start_dev:  	iounmap(core_dev->dev->ce_base);  err_iomap:  	free_irq(core_dev->irq, dev); +err_request_irq:  	irq_dispose_mapping(core_dev->irq);  	tasklet_kill(&core_dev->tasklet); -err_request_irq:  	crypto4xx_destroy_sdr(core_dev->dev);  err_build_sdr:  	crypto4xx_destroy_gdr(core_dev->dev); @@ -1280,7 +1285,7 @@ static const struct of_device_id crypto4xx_match[] = {  	{ },  }; -static struct of_platform_driver crypto4xx_driver = { +static struct platform_driver crypto4xx_driver = {  	.driver = {  		.name = "crypto4xx",  		.owner = THIS_MODULE, @@ -1290,18 +1295,7 @@ static struct of_platform_driver crypto4xx_driver = {  	.remove		= crypto4xx_remove,  }; -static int __init crypto4xx_init(void) -{ -	return of_register_platform_driver(&crypto4xx_driver); -} - -static void __exit crypto4xx_exit(void) -{ -	of_unregister_platform_driver(&crypto4xx_driver); -} - -module_init(crypto4xx_init); -module_exit(crypto4xx_exit); +module_platform_driver(crypto4xx_driver);  MODULE_LICENSE("GPL");  MODULE_AUTHOR("James Hsiao <jhsiao@amcc.com>");  | 
