caamrng.c (b2744dfd39c51e6fd56e79ff2eabf9953d45027e) | caamrng.c (313ea293e9c4d1eabcaddd2c0800f083b03c2a2e) |
---|---|
1/* 2 * caam - Freescale FSL CAAM support for hw_random 3 * 4 * Copyright 2011 Freescale Semiconductor, Inc. 5 * 6 * Based on caamalg.c crypto API driver. 7 * 8 * relationship between job descriptors to shared descriptors: --- 265 unchanged lines hidden (view full) --- 274static void __exit caam_rng_exit(void) 275{ 276 hwrng_unregister(&caam_rng); 277} 278 279static int __init caam_rng_init(void) 280{ 281 struct device_node *dev_node; | 1/* 2 * caam - Freescale FSL CAAM support for hw_random 3 * 4 * Copyright 2011 Freescale Semiconductor, Inc. 5 * 6 * Based on caamalg.c crypto API driver. 7 * 8 * relationship between job descriptors to shared descriptors: --- 265 unchanged lines hidden (view full) --- 274static void __exit caam_rng_exit(void) 275{ 276 hwrng_unregister(&caam_rng); 277} 278 279static int __init caam_rng_init(void) 280{ 281 struct device_node *dev_node; |
282 struct platform_device *pdev; | 282 struct platform_device *pdev, *jrpdev; |
283 struct device *ctrldev; 284 struct caam_drv_private *priv; 285 286 dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); 287 if (!dev_node) { 288 dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); 289 if (!dev_node) 290 return -ENODEV; --- 9 unchanged lines hidden (view full) --- 300 301 /* 302 * If priv is NULL, it's probably because the caam driver wasn't 303 * properly initialized (e.g. RNG4 init failed). Thus, bail out here. 304 */ 305 if (!priv) 306 return -ENODEV; 307 | 283 struct device *ctrldev; 284 struct caam_drv_private *priv; 285 286 dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0"); 287 if (!dev_node) { 288 dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0"); 289 if (!dev_node) 290 return -ENODEV; --- 9 unchanged lines hidden (view full) --- 300 301 /* 302 * If priv is NULL, it's probably because the caam driver wasn't 303 * properly initialized (e.g. RNG4 init failed). Thus, bail out here. 304 */ 305 if (!priv) 306 return -ENODEV; 307 |
308 caam_init_rng(&rng_ctx, priv->jrdev[0]); | 308 jrpdev = priv->jrpdev[0]; 309 caam_init_rng(&rng_ctx, &jrpdev->dev); |
309 | 310 |
310 dev_info(priv->jrdev[0], "registering rng-caam\n"); | 311 dev_info(&jrpdev->dev, "registering rng-caam\n"); |
311 return hwrng_register(&caam_rng); 312} 313 314module_init(caam_rng_init); 315module_exit(caam_rng_exit); 316 317MODULE_LICENSE("GPL"); 318MODULE_DESCRIPTION("FSL CAAM support for hw_random API"); 319MODULE_AUTHOR("Freescale Semiconductor - NMG"); | 312 return hwrng_register(&caam_rng); 313} 314 315module_init(caam_rng_init); 316module_exit(caam_rng_exit); 317 318MODULE_LICENSE("GPL"); 319MODULE_DESCRIPTION("FSL CAAM support for hw_random API"); 320MODULE_AUTHOR("Freescale Semiconductor - NMG"); |