From: davem@davemloft.net (David Miller)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver
Date: Fri, 15 Dec 2017 12:57:49 -0500 (EST) [thread overview]
Message-ID: <20171215.125749.1752831437819486183.davem@davemloft.net> (raw)
In-Reply-To: <1513245910-15961-3-git-send-email-hayashi.kunihiko@socionext.com>
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Date: Thu, 14 Dec 2017 19:05:10 +0900
> +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.
> + 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.
next prev parent reply other threads:[~2017-12-15 17:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-14 10:05 [PATCH net-next v6 0/2] add UniPhier AVE ethernet support Kunihiko Hayashi
2017-12-14 10:05 ` [PATCH net-next v6 1/2] dt-bindings: net: add DT bindings for Socionext UniPhier AVE Kunihiko Hayashi
2017-12-14 23:24 ` Florian Fainelli
2017-12-15 8:03 ` Kunihiko Hayashi
2017-12-14 10:05 ` [PATCH net-next v6 2/2] net: ethernet: socionext: add AVE ethernet driver Kunihiko Hayashi
2017-12-15 17:57 ` David Miller [this message]
2017-12-18 3:51 ` Kunihiko Hayashi
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=20171215.125749.1752831437819486183.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
/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