From b80e60eb8ecc77e479ed19a70d1b9e86f0fcc2ca Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Tue, 11 May 2021 15:04:21 +0200 Subject: [PATCH] hw_random: ixp4xx: Add OF support This makes the hardware random number generator found in the IXP46x SoCs probe from the device tree. Cc: Deepak Saxena Acked-by: Herbert Xu Signed-off-by: Linus Walleij --- drivers/char/hw_random/ixp4xx-rng.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/char/hw_random/ixp4xx-rng.c b/drivers/char/hw_random/ixp4xx-rng.c index 8b59aee..188854d 100644 --- a/drivers/char/hw_random/ixp4xx-rng.c +++ b/drivers/char/hw_random/ixp4xx-rng.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -55,9 +56,18 @@ static int ixp4xx_rng_probe(struct platform_device *pdev) return devm_hwrng_register(dev, &ixp4xx_rng_ops); } +static const struct of_device_id ixp4xx_rng_of_match[] = { + { + .compatible = "intel,ixp46x-rng", + }, + {}, +}; +MODULE_DEVICE_TABLE(of, ixp4xx_rng_of_match); + static struct platform_driver ixp4xx_rng_driver = { .driver = { .name = "ixp4xx-hwrandom", + .of_match_table = ixp4xx_rng_of_match, }, .probe = ixp4xx_rng_probe, }; -- 2.7.4