Skip to content

Commit 50d9a12

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: [CRYPTO] hifn795x: Disallow built-in hifn795x when HW_RANDOM is m
2 parents 29bd17a + 946fef4 commit 50d9a12

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

drivers/crypto/Kconfig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,16 @@ config CRYPTO_DEV_HIFN_795X
8888
select CRYPTO_DES
8989
select CRYPTO_ALGAPI
9090
select CRYPTO_BLKCIPHER
91+
select HW_RANDOM if CRYPTO_DEV_HIFN_795X_RNG
9192
depends on PCI
9293
help
9394
This option allows you to have support for HIFN 795x crypto adapters.
9495

95-
96+
config CRYPTO_DEV_HIFN_795X_RNG
97+
bool "HIFN 795x random number generator"
98+
depends on CRYPTO_DEV_HIFN_795X
99+
help
100+
Select this option if you want to enable the random number generator
101+
on the HIFN 795x crypto adapters.
96102

97103
endif # CRYPTO_HW

drivers/crypto/hifn_795x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ struct hifn_device
463463

464464
unsigned int pk_clk_freq;
465465

466-
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
466+
#ifdef CRYPTO_DEV_HIFN_795X_RNG
467467
unsigned int rng_wait_time;
468468
ktime_t rngtime;
469469
struct hwrng rng;
@@ -795,7 +795,7 @@ static struct pci2id {
795795
}
796796
};
797797

798-
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
798+
#ifdef CRYPTO_DEV_HIFN_795X_RNG
799799
static int hifn_rng_data_present(struct hwrng *rng, int wait)
800800
{
801801
struct hifn_device *dev = (struct hifn_device *)rng->priv;
@@ -880,7 +880,7 @@ static int hifn_init_pubrng(struct hifn_device *dev)
880880
dprintk("Chip %s: RNG engine has been successfully initialised.\n",
881881
dev->name);
882882

883-
#if defined(CONFIG_HW_RANDOM) || defined(CONFIG_HW_RANDOM_MODULE)
883+
#ifdef CRYPTO_DEV_HIFN_795X_RNG
884884
/* First value must be discarded */
885885
hifn_read_1(dev, HIFN_1_RNG_DATA);
886886
dev->rngtime = ktime_get();

0 commit comments

Comments
 (0)