linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: opensource@vdorst.com
Cc: netdev@vger.kernel.org, frank-w@public-files.de,
	sean.wang@mediatek.com, f.fainelli@gmail.com,
	linux@armlinux.org.uk, matthias.bgg@gmail.com, andrew@lunn.ch,
	vivien.didelot@gmail.com, john@phrozen.org,
	linux-mediatek@lists.infradead.org, linux-mips@vger.kernel.org,
	robh+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH net-next 1/3] net: ethernet: mediatek: Add basic PHYLINK support
Date: Fri, 26 Jul 2019 14:02:45 -0700 (PDT)	[thread overview]
Message-ID: <20190726.140245.129199617321965171.davem@davemloft.net> (raw)
In-Reply-To: <20190724192340.18978-1-opensource@vdorst.com>

From: René van Dorst <opensource@vdorst.com>
Date: Wed, 24 Jul 2019 21:23:40 +0200

> @@ -186,165 +187,219 @@ static void mtk_gmac0_rgmii_adjust(struct mtk_eth *eth, int speed)
>  	mtk_w32(eth, val, TRGMII_TCK_CTRL);
>  }
>  
> -static void mtk_phy_link_adjust(struct net_device *dev)
> +static void mtk_mac_config(struct phylink_config *config, unsigned int mode,
> +			   const struct phylink_link_state *state)
>  {
> -	struct mtk_mac *mac = netdev_priv(dev);
> -	u16 lcl_adv = 0, rmt_adv = 0;
> -	u8 flowctrl;
> -	u32 mcr = MAC_MCR_MAX_RX_1536 | MAC_MCR_IPG_CFG |
> -		  MAC_MCR_FORCE_MODE | MAC_MCR_TX_EN |
> -		  MAC_MCR_RX_EN | MAC_MCR_BACKOFF_EN |
> -		  MAC_MCR_BACKPR_EN;
> +	struct mtk_mac *mac = container_of(config, struct mtk_mac,
> +					   phylink_config);
> +	struct mtk_eth *eth = mac->hw;
>  
> -	if (unlikely(test_bit(MTK_RESETTING, &mac->hw->state)))
> -		return;
> +	u32 ge_mode = 0, val, mcr_cur, mcr_new;

Please elminiate the empty line in the middle of the local variabel
declarations and adhere to reverse christmas tree ordering.
> @@ -1798,6 +1853,13 @@ static int mtk_open(struct net_device *dev)
>  {
>  	struct mtk_mac *mac = netdev_priv(dev);
>  	struct mtk_eth *eth = mac->hw;
> +	int err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);

Reverse christmas tree please.

> @@ -2375,9 +2407,10 @@ static const struct net_device_ops mtk_netdev_ops = {
>  
>  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
>  {
> +	struct phylink *phylink;
>  	struct mtk_mac *mac;
>  	const __be32 *_id = of_get_property(np, "reg", NULL);
> -	int id, err;
> +	int phy_mode, id, err;

While you are here please fix up the reverse christmas tree ordering, and
definitely don't make it worse :)

      reply	other threads:[~2019-07-26 21:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-24 19:23 [PATCH net-next 1/3] net: ethernet: mediatek: Add basic PHYLINK support René van Dorst
2019-07-26 21:02 ` David Miller [this message]

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=20190726.140245.129199617321965171.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frank-w@public-files.de \
    --cc=john@phrozen.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=opensource@vdorst.com \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@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).