Thread (37 messages) 37 messages, 2 authors, 2021-07-02

Re: [RFCv1 1/8] phy: amlogic: meson8b-usb2: Use clock bulk to get clocks for phy

flat view

From: Anand Moon <hidden>
Date: 2021-06-18 15:33:37
Also in: linux-amlogic, linux-phy, lkml

Hi Martin,

On Fri, 18 Jun 2021 at 04:03, Martin Blumenstingl
[off-list ref] wrote:
Hi Anand,

On Thu, Jun 17, 2021 at 9:42 PM Anand Moon [off-list ref] wrote:
[...]
quoted
+       int                                             num_clks;
+       struct clk_bulk_data                            *clks;
personally I'd get rid of the num_clks as this value is static
instead I would add a #define with the number of clocks and then...
quoted
        struct reset_control                            *reset;
... use something like:
struct clk_bulk_data                            clks[MESON8B_USB2_PHY_NUM_CLKS];

[...]
quoted
+               dev_err(&phy->dev, "Failed to enable USB clock\n");
clock -> clocks

[...]
quoted
+       priv->num_clks = ARRAY_SIZE(meson_phy_clks);
+       priv->clks = devm_kcalloc(&pdev->dev, priv->num_clks,
+                                 sizeof(*priv->clks), GFP_KERNEL);
+       if (!priv->clks)
+               return -ENOMEM;
by using a fixed-size array as suggested above you don't need to
dynamically allocate memory anymore
Thanks for this tip.It works for me.
Best regards,
Martin
Thanks

-Anand

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help