crypto: nx - prevent nx 842 load if no hw driver
authorDan Streetman <ddstreet@ieee.org>
Thu, 28 May 2015 20:21:31 +0000 (16:21 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 3 Jun 2015 02:51:23 +0000 (10:51 +0800)
commit3e648cbeb31be5cb84b9ec19822e2b85417f07c4
tree4832384e797c3164b3d4321e49f13dd5a8c74c9d
parentf614e546f5060813ddf69a090cdf200a9ac28cd3
crypto: nx - prevent nx 842 load if no hw driver

Change the nx-842 common driver to wait for loading of both platform
drivers, and fail loading if the platform driver pointer is not set.
Add an independent platform driver pointer, that the platform drivers
set if they find they are able to load (i.e. if they find their platform
devicetree node(s)).

The problem is currently, the main nx-842 driver will stay loaded even
if there is no platform driver and thus no possible way it can do any
compression or decompression.  This allows the crypto 842-nx driver
to load even if it won't actually work.  For crypto compression users
(e.g. zswap) that expect an available crypto compression driver to
actually work, this is bad.  This patch fixes that, so the 842-nx crypto
compression driver won't load if it doesn't have the driver and hardware
available to perform the compression.

Signed-off-by: Dan Streetman <ddstreet@ieee.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/Makefile
drivers/crypto/nx/nx-842-platform.c [new file with mode: 0644]
drivers/crypto/nx/nx-842-powernv.c
drivers/crypto/nx/nx-842-pseries.c
drivers/crypto/nx/nx-842.c
drivers/crypto/nx/nx-842.h