[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220422054919.6f056300@kicinski-fedora-PC1C0HJN>
Date: Fri, 22 Apr 2022 05:49:19 -0700
From: Jakub Kicinski <kubakici@...pl>
To: Kalle Valo <kvalo@...nel.org>
Cc: Bernard Zhao <zhaojunkui2008@....com>,
"David S. Miller" <davem@...emloft.net>,
Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
bernard@...o.com
Subject: Re: [PATCH] mediatek/mt7601u: add debugfs exit function
On Fri, 22 Apr 2022 10:45:57 +0300 Kalle Valo wrote:
> > When mt7601u loaded, there are two cases:
> > First when mt7601u is loaded, in function mt7601u_probe, if
> > function mt7601u_probe run into error lable err_hw,
> > mt7601u_cleanup didn`t cleanup the debugfs node.
> > Second when the module disconnect, in function mt7601u_disconnect,
> > mt7601u_cleanup didn`t cleanup the debugfs node.
> > This patch add debugfs exit function and try to cleanup debugfs
> > node when mt7601u loaded fail or unloaded.
Is this actually needed? Looks like wireless has a wiphy debugfs dir
now, so the entire thing should get removed recursively when probe
fails. The driver is not doing anything special.
> > diff --git a/drivers/net/wireless/mediatek/mt7601u/debugfs.c b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
> > index 20669eacb66e..1ae3d75d3c9b 100644
> > --- a/drivers/net/wireless/mediatek/mt7601u/debugfs.c
> > +++ b/drivers/net/wireless/mediatek/mt7601u/debugfs.c
> > @@ -124,17 +124,22 @@ DEFINE_SHOW_ATTRIBUTE(mt7601u_eeprom_param);
> >
> > void mt7601u_init_debugfs(struct mt7601u_dev *dev)
> > {
> > - struct dentry *dir;
> > -
> > - dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir);
> > - if (!dir)
> > + dev->root_dir = debugfs_create_dir("mt7601u", dev->hw->wiphy->debugfsdir);
> > + if (!dev->root_dir)
> > return;
Powered by blists - more mailing lists