[PATCH v2 3/6] clk: meson: update driver for g12a-ao clocks
Neil Armstrong
narmstrong at baylibre.com
Fri Apr 22 15:26:11 CEST 2022
On 22/04/2022 07:29, Vyacheslav Bocharov wrote:
> Move clk->id check to .request function
>
> Signed-off-by: Vyacheslav Bocharov <adeep at lexina.in>
> ---
> drivers/clk/meson/g12a-ao.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/meson/g12a-ao.c b/drivers/clk/meson/g12a-ao.c
> index 17b11eb52a..22c85cff1d 100644
> --- a/drivers/clk/meson/g12a-ao.c
> +++ b/drivers/clk/meson/g12a-ao.c
> @@ -28,9 +28,6 @@ static int meson_set_gate(struct clk *clk, bool on)
> struct meson_clk *priv = dev_get_priv(clk->dev);
> struct meson_gate *gate;
>
> - if (clk->id >= ARRAY_SIZE(gates))
> - return -ENOENT;
> -
> gate = &gates[clk->id];
>
> if (gate->reg == 0)
> @@ -63,9 +60,18 @@ static int meson_clk_probe(struct udevice *dev)
> return 0;
> }
>
> +static int meson_clk_request(struct clk *clk)
> +{
> + if (clk->id >= ARRAY_SIZE(gates))
> + return -ENOENT;
> +
> + return 0;
> +}
> +
> static struct clk_ops meson_clk_ops = {
> .disable = meson_clk_disable,
> .enable = meson_clk_enable,
> + .request = meson_clk_request,
> };
>
> static const struct udevice_id meson_clk_ids[] = {
Acked-by: Neil Armstrong <narmstrong at baylibre.com>
More information about the U-Boot
mailing list