[U-Boot] [PATCH 1/2] clk: at91: enhance the peripheral clock

Simon Glass sjg at chromium.org
Fri Mar 3 04:52:12 UTC 2017


On 22 February 2017 at 03:01, Wenyou Yang <wenyou.yang at atmel.com> wrote:
>
> Enhance the peripheral clock to support both at9sam9x5's
> and at91rm9200's peripheral clock via the different compatibles.
>
> Signed-off-by: Wenyou Yang <wenyou.yang at atmel.com>
> ---
>
>  drivers/clk/at91/clk-peripheral.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

But I suggest you using something better than 0 and 1 for the
different types. Eg. an enum with a descriptive name.

>
> diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
> index e1ed447133..8a4c88566b 100644
> --- a/drivers/clk/at91/clk-peripheral.c
> +++ b/drivers/clk/at91/clk-peripheral.c
> @@ -28,7 +28,8 @@ static int sam9x5_periph_clk_bind(struct udevice *dev)
>  }
>
>  static const struct udevice_id sam9x5_periph_clk_match[] = {
> -       { .compatible = "atmel,at91sam9x5-clk-peripheral" },
> +       { .compatible = "atmel,at91rm9200-clk-peripheral", .data = 0 },
> +       { .compatible = "atmel,at91sam9x5-clk-peripheral", .data = 1 },
>         {}
>  };


More information about the U-Boot mailing list