summaryrefslogtreecommitdiffstats
path: root/drivers/char/hw_random/cctrng.c
Commit message (Collapse)AuthorAgeFilesLines
* hwrng: cctrng - Add missing clk_disable_unprepare in cctrng_resumeGaosheng Cui2024-08-101-0/+1
| | | | | | | | | | Add the missing clk_disable_unprepare() before return in cctrng_resume(). Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver") Cc: <stable@vger.kernel.org> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - Convert to platform remove callback returning voidUwe Kleine-König2023-12-151-4/+2
| | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - use dev_err_probe in error pathsMartin Kaiser2023-07-281-20/+10
| | | | | | | Use dev_err_probe in error paths to make the code a bit shorter. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - merge cc_trng_clk_init into its only callerMartin Kaiser2023-07-281-20/+4
| | | | | | | | cc_trng_clk_init is called only from the probe function. Merge the two functions, this saves some lines of code. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - let devres enable the clockMartin Kaiser2023-07-281-24/+5
| | | | | | | | | Call devm_clk_get_optional_enabled in the cctrng driver. We don't have to disable and unprepare the clock any more in error paths or in the remove function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - don't open code init and exit functionsMartin Kaiser2023-07-281-15/+5
| | | | | | | | | | Do not open code the init and exit functions of the cctrng driver. If we move the BUILD_BUG_ON checks into the probe function, we can use module_platform_driver and make the code shorter. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - delete redundant printing of return valueWang Qing2021-03-191-3/+1
| | | | | | | | platform_get_irq() has already checked and printed the return value, the printing here is nothing special, it is not necessary at all. Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - use devm_platform_ioremap_resource() to simplifyTian Tao2021-03-191-11/+1
| | | | | | | Use devm_platform_ioremap_resource() to simplify the code. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - Use device-managed registration APITian Tao2021-03-131-3/+1
| | | | | | | Use devm_hwrng_register to get rid of manual unregistration. Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrn - Simplify with dev_err_probe()Krzysztof Kozlowski2020-09-041-5/+4
| | | | | | | | | Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and also it prints the error value. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Hadar Gat <hadar.gat@arm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - Make some symbols staticZou Wei2020-04-301-2/+2
| | | | | | | | | | | | | | Fix the following sparse warnings: drivers/char/hw_random/cctrng.c:316:6: warning: symbol 'cc_trng_compwork_handler' was not declared. Should it be static? drivers/char/hw_random/cctrng.c:451:6: warning: symbol 'cc_trng_startwork_handler' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Hadar Gat <hadar.gat@arm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - Remove unnecessary FIPS ifdefHerbert Xu2020-04-301-3/+1
| | | | | | | | This patch removes the unnecessary FIPS ifdef in cctrng. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Hadar Gat <hadar.gat@arm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - add missing include to linux/fips.hHadar Gat2020-04-201-0/+1
| | | | | | | | | | | This fixes build failure when CONFIG_CRYPTO_FIPS is defined. Fixes: a583ed310bb6 ("hwrng: cctrng - introduce Arm CryptoCell driver") Signed-off-by: Hadar Gat <hadar.gat@arm.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* hwrng: cctrng - introduce Arm CryptoCell driverHadar Gat2020-04-161-0/+736
Introduce low level Arm CryptoCell TRNG HW support. Signed-off-by: Hadar Gat <hadar.gat@arm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>