From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Jiping Ma <jiping.ma2@windriver.com>,
peppe.cavallaro@st.com, alexandre.torgue@st.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
joabreu@synopsys.com, mcoquelin.stm32@gmail.com,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] stmmac: debugfs entry name is not be changed when udev rename device name.
Date: Tue, 31 Dec 2019 13:12:29 +0300 [thread overview]
Message-ID: <57dcdaa1-feff-1134-919e-57b37e306431@cogentembedded.com> (raw)
In-Reply-To: <20191231020302.71792-1-jiping.ma2@windriver.com>
Hello!
On 31.12.2019 5:03, Jiping Ma wrote:
> Add one notifier for udev changes net device name.
>
> Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
> ---
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 38 ++++++++++++++++++-
> 1 file changed, 37 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b14f46a57154..c1c877bb4421 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -4038,6 +4038,40 @@ static int stmmac_dma_cap_show(struct seq_file *seq, void *v)
> }
> DEFINE_SHOW_ATTRIBUTE(stmmac_dma_cap);
>
> +/**
> + * Use network device events to create/remove/rename
> + * debugfs file entries
> + */
> +static int stmmac_device_event(struct notifier_block *unused,
> + unsigned long event, void *ptr)
> +{
> + struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> + struct stmmac_priv *priv = netdev_priv(dev);
> +
> + switch (event) {
> + case NETDEV_CHANGENAME:
> + if (priv->dbgfs_dir)
> + priv->dbgfs_dir = debugfs_rename(stmmac_fs_dir,
> + priv->dbgfs_dir,
> + stmmac_fs_dir,
> + dev->name);
> + break;
> +
> + case NETDEV_GOING_DOWN:
> + break;
> +
> + case NETDEV_UP:
> + break;
Why not merge the above 2 cases? Or just remove them('event' is not *enum*)?
> + }
> +
> +done:
> + return NOTIFY_DONE;
> +}
[...]
MBR, Sergei
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-12-31 10:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20191231020302.71792-1-jiping.ma2@windriver.com>
2019-12-31 2:11 ` [PATCH] stmmac: debugfs entry name is not be changed when udev rename device name Randy Dunlap
[not found] ` <719d8dd3-0119-0c93-b299-d2b3d66b1e06@windriver.com>
2019-12-31 2:22 ` Randy Dunlap
2019-12-31 10:12 ` Sergei Shtylyov [this message]
[not found] <20200102013544.19271-1-jiping.ma2@windriver.com>
2020-01-05 4:18 ` David Miller
[not found] <20200106023341.206459-1-jiping.ma2@windriver.com>
2020-01-06 21:45 ` David Miller
[not found] ` <15aedd71-e077-4c6c-e30c-9396d16eaeec@windriver.com>
2020-01-07 2:22 ` David Miller
[not found] ` <99d183bc-7668-7749-54d6-3649c549dec8@windriver.com>
2020-01-07 4:44 ` Florian Fainelli
2020-01-07 21:01 ` David Miller
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=57dcdaa1-feff-1134-919e-57b37e306431@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=alexandre.torgue@st.com \
--cc=jiping.ma2@windriver.com \
--cc=joabreu@synopsys.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=peppe.cavallaro@st.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).