[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4de343a7-e47f-2f72-4f5a-17ea9c7c0e1a@windriver.com>
Date: Thu, 2 Jan 2020 08:38:18 +0800
From: Jiping Ma <Jiping.Ma2@...driver.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
<peppe.cavallaro@...com>, <alexandre.torgue@...com>
CC: <joabreu@...opsys.com>, <mcoquelin.stm32@...il.com>,
<netdev@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-stm32@...md-mailman.stormreply.com>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] stmmac: debugfs entry name is not be changed when udev
rename device name.
On 12/31/2019 06:12 PM, Sergei Shtylyov wrote:
> 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@...driver.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*)?
I will remove them.
Thanks,
>
>> + }
>> +
>> +done:
>> + return NOTIFY_DONE;
>> +}
> [...]
>
> MBR, Sergei
>
Powered by blists - more mailing lists