[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2c62f337-5eb4-e525-7e3a-289435315c09@collabora.com>
Date: Mon, 17 Jan 2022 11:38:14 +0100
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Biao Huang <biao.huang@...iatek.com>, davem@...emloft.net,
Jakub Kicinski <kuba@...nel.org>,
Rob Herring <robh+dt@...nel.org>
Cc: Matthias Brugger <matthias.bgg@...il.com>,
Giuseppe Cavallaro <peppe.cavallaro@...com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Jose Abreu <joabreu@...opsys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org,
linux-stm32@...md-mailman.stormreply.com,
srv_heupstream@...iatek.com, macpaul.lin@...iatek.com,
dkirjanov@...e.de
Subject: Re: [PATCH net-next v12 3/7] stmmac: dwmac-mediatek: re-arrange clock
setting
Il 17/01/22 08:07, Biao Huang ha scritto:
> The rmii_internal clock is needed only when PHY
> interface is RMII, and reference clock is from MAC.
>
> Re-arrange the clock setting as following:
> 1. the optional "rmii_internal" is controlled by devm_clk_get(),
> 2. other clocks still be configured by devm_clk_bulk_get().
>
> Signed-off-by: Biao Huang <biao.huang@...iatek.com>
> ---
> .../ethernet/stmicro/stmmac/dwmac-mediatek.c | 72 +++++++++++++------
> 1 file changed, 49 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> index 8747aa4403e8..2678d2deb26a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-mediatek.c
> @@ -49,14 +49,15 @@ struct mac_delay_struct {
> struct mediatek_dwmac_plat_data {
> const struct mediatek_dwmac_variant *variant;
> struct mac_delay_struct mac_delay;
> + struct clk *rmii_internal_clk;
> struct clk_bulk_data *clks;
> - struct device_node *np;
> struct regmap *peri_regmap;
> + struct device_node *np;
> struct device *dev;
> phy_interface_t phy_mode;
> - int num_clks_to_config;
> bool rmii_clk_from_mac;
> bool rmii_rxc;
> + int num_clks;
I don't see any need to get a num_clks here, at this point: since all functions
reading this are getting passed a pointer to this entire structure, you can
simply always access plat->variant->num_clks.
Please, drop the addition of num_clks in this struct.
Regards,
Angelo
Powered by blists - more mailing lists