From: Vladimir Oltean <olteanv@gmail.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Russell King" <linux@armlinux.org.uk>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Lorenzo Bianconi" <lorenzo@kernel.org>,
"Mark Lee" <Mark-MC.Lee@mediatek.com>,
"John Crispin" <john@phrozen.org>, "Felix Fietkau" <nbd@nbd.name>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"DENG Qingfang" <dqfext@gmail.com>,
"Landen Chao" <Landen.Chao@mediatek.com>,
"Sean Wang" <sean.wang@mediatek.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Eric Dumazet" <edumazet@google.com>,
"David S. Miller" <davem@davemloft.net>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Jianhui Zhao" <zhaojh329@gmail.com>,
"Bjørn Mork" <bjorn@mork.no>
Subject: Re: [PATCH 8/9] net: ethernet: mtk_eth_soc: switch to external PCS driver
Date: Fri, 3 Feb 2023 23:56:22 +0200 [thread overview]
Message-ID: <20230203215622.z6mzsu37dipwg2bd@skbuf> (raw)
In-Reply-To: <3bac780184867e111c3a1567d8b55658abd931da.1675407169.git.daniel@makrotopia.org> <3bac780184867e111c3a1567d8b55658abd931da.1675407169.git.daniel@makrotopia.org>
On Fri, Feb 03, 2023 at 07:06:10AM +0000, Daniel Golle wrote:
> int mtk_sgmii_init(struct mtk_sgmii *ss, struct device_node *r, u32 ana_rgc3)
> {
> struct device_node *np;
> int i;
> + u32 flags;
> + struct regmap *regmap;
>
> for (i = 0; i < MTK_MAX_DEVS; i++) {
> np = of_parse_phandle(r, "mediatek,sgmiisys", i);
> if (!np)
> break;
>
> - ss->pcs[i].ana_rgc3 = ana_rgc3;
> - ss->pcs[i].regmap = syscon_node_to_regmap(np);
> -
> - ss->pcs[i].flags = 0;
> + flags = 0;
> if (of_property_read_bool(np, "pn_swap"))
> - ss->pcs[i].flags |= MTK_SGMII_FLAG_PN_SWAP;
> + flags |= MTK_SGMII_FLAG_PN_SWAP;
>
> of_node_put(np);
> - if (IS_ERR(ss->pcs[i].regmap))
> - return PTR_ERR(ss->pcs[i].regmap);
>
> - ss->pcs[i].pcs.ops = &mtk_pcs_ops;
> - ss->pcs[i].pcs.poll = true;
> - ss->pcs[i].interface = PHY_INTERFACE_MODE_NA;
> + regmap = syscon_node_to_regmap(np);
Not supposed to use "np" after of_node_put().
> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);
> +
> + ss->pcs[i] = mtk_pcs_create(ss->dev, regmap, ana_rgc3, flags);
> }
next prev parent reply other threads:[~2023-02-03 21:56 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 6:58 [PATCH 0/9] net: ethernet: mtk_eth_soc: various enhancements Daniel Golle
2023-02-03 7:00 ` [PATCH 1/9] net: ethernet: mtk_eth_soc: add support for MT7981 SoC Daniel Golle
2023-02-03 14:00 ` Andrew Lunn
2023-02-03 14:18 ` Vladimir Oltean
2023-02-03 21:51 ` Vladimir Oltean
2023-02-03 7:01 ` [PATCH 2/9] net: ethernet: mtk_eth_soc: set MDIO bus clock frequency Daniel Golle
2023-02-03 14:06 ` Andrew Lunn
2023-02-03 21:48 ` Vladimir Oltean
2023-02-03 22:15 ` Andrew Lunn
2023-02-03 22:26 ` Vladimir Oltean
2023-02-03 7:01 ` [PATCH 3/9] net: ethernet: mtk_eth_soc: reset PCS state Daniel Golle
2023-02-03 7:02 ` [PATCH 4/9] net: ethernet: mtk_eth_soc: only write values if needed Daniel Golle
2023-02-03 14:08 ` Andrew Lunn
2023-02-03 7:02 ` [PATCH 5/9] net: ethernet: mtk_eth_soc: fix RX data corruption issue Daniel Golle
2023-02-03 14:09 ` Andrew Lunn
2023-02-03 7:05 ` [PATCH 6/9] net: ethernet: mtk_eth_soc: ppe: add support for flow accounting Daniel Golle
2023-02-03 22:55 ` Vladimir Oltean
2023-02-03 7:05 ` [PATCH 7/9] net: pcs: add driver for MediaTek SGMII PCS Daniel Golle
2023-02-03 14:14 ` Andrew Lunn
2023-02-03 15:00 ` Vladimir Oltean
2023-02-03 15:21 ` Andrew Lunn
2023-02-03 7:06 ` [PATCH 8/9] net: ethernet: mtk_eth_soc: switch to external PCS driver Daniel Golle
2023-02-03 9:25 ` Bjørn Mork
2023-02-03 21:56 ` Vladimir Oltean [this message]
2023-02-03 7:06 ` [PATCH 9/9] net: dsa: mt7530: use " Daniel Golle
2023-02-03 22:19 ` Vladimir Oltean
2023-02-04 15:02 ` Daniel Golle
2023-02-04 17:13 ` Andrew Lunn
2023-02-04 23:41 ` Russell King (Oracle)
2023-02-05 12:13 ` Vladimir Oltean
2023-02-04 11:08 ` [PATCH 0/9] net: ethernet: mtk_eth_soc: various enhancements Bjørn Mork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230203215622.z6mzsu37dipwg2bd@skbuf \
--to=olteanv@gmail.com \
--cc=Landen.Chao@mediatek.com \
--cc=Mark-MC.Lee@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bjorn@mork.no \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=john@phrozen.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=lorenzo@kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=nbd@nbd.name \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.com \
--cc=zhaojh329@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).