2016-01-17 09:03:33

by Álvaro Fernández Rojas

[permalink] [raw]
Subject: [PATCH 2/4] hw_random: bcm63xx-rng: add device tree support

Adds device tree support for BCM6368, which seems to be the only BCM63xx with
bcm63xx-rng support.

Signed-off-by: Álvaro Fernández Rojas <[email protected]>
---
drivers/char/hw_random/bcm63xx-rng.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/char/hw_random/bcm63xx-rng.c b/drivers/char/hw_random/bcm63xx-rng.c
index c303f30..38553f0 100644
--- a/drivers/char/hw_random/bcm63xx-rng.c
+++ b/drivers/char/hw_random/bcm63xx-rng.c
@@ -130,10 +130,17 @@ static int bcm63xx_rng_probe(struct platform_device *pdev)
return 0;
}

+static const struct of_device_id bcm63xx_rng_of_match[] = {
+ { .compatible = "brcm,bcm6368-rng", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, bcm63xx_rng_of_match);
+
static struct platform_driver bcm63xx_rng_driver = {
.probe = bcm63xx_rng_probe,
.driver = {
.name = "bcm63xx-rng",
+ .of_match_table = bcm63xx_rng_of_match,
},
};

--
1.9.1


2016-01-18 19:12:39

by Florian Fainelli

[permalink] [raw]
Subject: Re: [PATCH 2/4] hw_random: bcm63xx-rng: add device tree support

Le 17/01/2016 01:03, Álvaro Fernández Rojas a écrit :
> Adds device tree support for BCM6368, which seems to be the only BCM63xx with
> bcm63xx-rng support.
>
> Signed-off-by: Álvaro Fernández Rojas <[email protected]>
> ---
> drivers/char/hw_random/bcm63xx-rng.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/char/hw_random/bcm63xx-rng.c b/drivers/char/hw_random/bcm63xx-rng.c
> index c303f30..38553f0 100644
> --- a/drivers/char/hw_random/bcm63xx-rng.c
> +++ b/drivers/char/hw_random/bcm63xx-rng.c
> @@ -130,10 +130,17 @@ static int bcm63xx_rng_probe(struct platform_device *pdev)
> return 0;
> }
>

#ifdef CONFIG_OF here?

> +static const struct of_device_id bcm63xx_rng_of_match[] = {
> + { .compatible = "brcm,bcm6368-rng", },
> + {},
> +};
> +MODULE_DEVICE_TABLE(of, bcm63xx_rng_of_match);
> +
> static struct platform_driver bcm63xx_rng_driver = {
> .probe = bcm63xx_rng_probe,
> .driver = {
> .name = "bcm63xx-rng",
> + .of_match_table = bcm63xx_rng_of_match,

of_match_ptr(bcm63xx_rng_of_match) would be nice here as well since we
can still build this driver for BCM63XX which is not OF enabled.

Other than that:

Reviewed-by: Florian Fainelli <[email protected]>
--
Florian