Thread (7 messages) 7 messages, 3 authors, 2017-12-18

[PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver

From: hayashi.kunihiko@socionext.com (Kunihiko Hayashi)
Date: 2017-12-18 03:51:10
Also in: linux-devicetree, lkml, netdev

Hello David,

On Fri, 15 Dec 2017 12:57:49 -0500 David Miller [off-list ref] wrote:
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: Thu, 14 Dec 2017 19:05:10 +0900
quoted
+static void ave_desc_write(struct net_device *ndev, enum desc_id id,
+			   int entry, int offset, u32 val)
+{
+	struct ave_private *priv = netdev_priv(ndev);
+	u32 addr = (id == AVE_DESCID_TX) ? priv->tx.daddr : priv->rx.daddr;
Please always order local variables from longest to shortest line.

Audit your entire submission for this issue, thank you.
I see. I'll fix the order of local variables.
quoted
+	ret = register_netdev(ndev);
+	if (ret) {
+		dev_err(dev, "failed to register netdevice\n");
+		goto out_del_napi;
+	}
+
+	platform_set_drvdata(pdev, ndev);
You must make all software state settings before reigster_netdev() is
invoked.

At the exact moment you call register_netdev(), your device can be
brought up, interrupts processed, PHY state changes made, etc.

So you must put this platform_set_drvdata() before the
register_netdev() call.

Generally speaking, register_netdev() must always be the last state
modification done by your probe routine.
Indeed. It's not good to invoke register_netdev() with all software
initialization not completed. I'll move register_netdev() after
all initialization.

Thank you,

---
Best Regards,
Kunihiko Hayashi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help