Message ID | 1439534769-22811-2-git-send-email-lho@apm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Aug 14, 2015 at 12:46:06AM -0600, Loc Ho wrote: > This patch exports and expose the edac_debugfs file node. This allows > EDAC driver to create debugfs node under the EDAC debugfs node. ... > -#ifdef CONFIG_EDAC_DEBUG > -static struct dentry *edac_debugfs; > +struct dentry *edac_debugfs; > +EXPORT_SYMBOL_GPL(edac_debugfs); Hmm, so Arnd was right about this being the wrong direction we're chasing. We should rather be exporting a bunch of EDAC debugfs wrappers which EDAC drivers can call instead of exposing edac_debugfs itself. And this is much better and the right(tm) approach IMO. So I went and hacked it in, it builds on those !x86 targets (as far as my cross-compilers are concerned, build succeeds :-)). So here it is as a follow-up to this message.
Hi, >> This patch exports and expose the edac_debugfs file node. This allows >> EDAC driver to create debugfs node under the EDAC debugfs node. > > ... > >> -#ifdef CONFIG_EDAC_DEBUG >> -static struct dentry *edac_debugfs; >> +struct dentry *edac_debugfs; >> +EXPORT_SYMBOL_GPL(edac_debugfs); > > Hmm, so Arnd was right about this being the wrong direction we're > chasing. We should rather be exporting a bunch of EDAC debugfs wrappers > which EDAC drivers can call instead of exposing edac_debugfs itself. > > And this is much better and the right(tm) approach IMO. So I went > and hacked it in, it builds on those !x86 targets (as far as my > cross-compilers are concerned, build succeeds :-)). > > So here it is as a follow-up to this message. Let's me sync and give it a try. Do you see any other issue besides this? -Loc
On Tue, Sep 22, 2015 at 10:46:07AM -0700, Loc Ho wrote:
> Let's me sync and give it a try. Do you see any other issue besides this?
I replied to each message separately but they were all small nitpicks
only.
Btw, I have the debugfs pile here if you want to base your stuff ontop:
git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#edac-debugfs
Thanks.
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index ad42587..a978a4f 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h @@ -511,5 +511,6 @@ extern void edac_pci_remove_sysfs(struct edac_pci_ctl_info *pci); * edac misc APIs */ extern char *edac_op_state_to_string(int op_state); +extern struct dentry *edac_debugfs; #endif /* _EDAC_CORE_H_ */ diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 33df7d9..236e76c 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -896,9 +896,10 @@ static struct device_type mci_attr_type = { .release = mci_attr_release, }; -#ifdef CONFIG_EDAC_DEBUG -static struct dentry *edac_debugfs; +struct dentry *edac_debugfs; +EXPORT_SYMBOL_GPL(edac_debugfs); +#ifdef CONFIG_EDAC_DEBUG int __init edac_debugfs_init(void) { edac_debugfs = debugfs_create_dir("edac", NULL);
This patch exports and expose the edac_debugfs file node. This allows EDAC driver to create debugfs node under the EDAC debugfs node. Signed-off-by: Loc Ho <lho@apm.com> --- drivers/edac/edac_core.h | 1 + drivers/edac/edac_mc_sysfs.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-)