[PATCH v1 1/2] fu540: prci: add request and free clock handlers
Sean Anderson
seanga2 at gmail.com
Fri Feb 21 07:22:57 CET 2020
On 2/18/20 11:13 AM, Sagar Shrikant Kadam wrote:
> +static int sifive_fu540_prci_clk_free(struct clk *clk)
> +{
> + debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev,
> + clk->id);
> +
> + if (clk->id >= ARRAY_SIZE(__prci_init_clocks))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
I don't think this function is necessary, since no struct clk should be
passed to clk_free except one which was previously successfully
requested.
> static int sifive_fu540_prci_probe(struct udevice *dev)
> {
> int i, err;
> @@ -611,6 +633,8 @@ static int sifive_fu540_prci_probe(struct udevice *dev)
> static struct clk_ops sifive_fu540_prci_ops = {
> .set_rate = sifive_fu540_prci_set_rate,
> .get_rate = sifive_fu540_prci_get_rate,
> + .request = sifive_fu540_prci_clk_request,
> + .rfree = sifive_fu540_prci_clk_free,
> };
>
> static const struct udevice_id sifive_fu540_prci_ids[] = {
>
--Sean
More information about the U-Boot
mailing list