hwrng: bcm2835 - fix probe as platform device
authorJonas Gorski <jonas.gorski@gmail.com>
Tue, 19 Feb 2019 12:16:08 +0000 (13:16 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 28 Feb 2019 06:17:58 +0000 (14:17 +0800)
commit984798de671a927ac73da31096a150df42e6aaf3
treed3c9b3202635975b2f94403e0d13e0d41934e301
parentef5c73b3384743efae6d6080154e189dc672359f
hwrng: bcm2835 - fix probe as platform device

BCM63XX (MIPS) does not use device tree, so there cannot be any
of_device_id, causing the driver to fail on probe:

[    0.904564] bcm2835-rng: probe of bcm63xx-rng failed with error -22

Fix this by checking for match data only if we are probing from device
tree.

Fixes: 8705f24f7b57 ("hwrng: bcm2835 - Enable BCM2835 RNG to work on BCM63xx platforms")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/bcm2835-rng.c