From db34cf9122319d6fed59bd3ba26fa099a8ece432 Mon Sep 17 00:00:00 2001 From: Tom Lendacky Date: Mon, 6 Jan 2014 13:34:29 -0600 Subject: crypto: ccp - CCP device enabled/disabled changes The CCP cannot be hot-plugged so it will either be there or it won't. Do not allow the driver to stay loaded if the CCP does not successfully initialize. Provide stub routines in the ccp.h file that return -ENODEV if the CCP has not been configured in the build. Signed-off-by: Tom Lendacky Signed-off-by: Herbert Xu --- include/linux/ccp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/linux/ccp.h') diff --git a/include/linux/ccp.h b/include/linux/ccp.h index 12f1cfdbd3a3..b941ab9f762b 100644 --- a/include/linux/ccp.h +++ b/include/linux/ccp.h @@ -23,6 +23,9 @@ struct ccp_device; struct ccp_cmd; +#if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \ + defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE) + /** * ccp_enqueue_cmd - queue an operation for processing by the CCP * @@ -48,6 +51,15 @@ struct ccp_cmd; */ int ccp_enqueue_cmd(struct ccp_cmd *cmd); +#else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */ + +static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd) +{ + return -ENODEV; +} + +#endif /* CONFIG_CRYPTO_DEV_CCP_DD */ + /***** AES engine *****/ /** -- cgit v1.2.1