Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319387
b: refs/heads/master
c: e7930ba
h: refs/heads/master
i:
  319385: db4e8a5
  319383: 4fb70ff
v: v3
  • Loading branch information
Rob Herring authored and Mauro Carvalho Chehab committed Jun 12, 2012
1 parent 6ab98ae commit 0cf89be
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c10538396bf3f0076630103ede49c863c27db720
refs/heads/master: e7930ba49e469d9ce7374a788336caf955f8d7e2
23 changes: 22 additions & 1 deletion trunk/drivers/edac/edac_mc_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,13 +899,33 @@ static struct device_type mci_attr_type = {
};

#ifdef CONFIG_EDAC_DEBUG
static struct dentry *edac_debugfs;

int __init edac_debugfs_init(void)
{
edac_debugfs = debugfs_create_dir("edac", NULL);
if (IS_ERR(edac_debugfs)) {
edac_debugfs = NULL;
return -ENOMEM;
}
return 0;
}

void __exit edac_debugfs_exit(void)
{
debugfs_remove(edac_debugfs);
}

int edac_create_debug_nodes(struct mem_ctl_info *mci)
{
struct dentry *d, *parent;
char name[80];
int i;

d = debugfs_create_dir(mci->dev.kobj.name, mci->debugfs);
if (!edac_debugfs)
return -ENODEV;

d = debugfs_create_dir(mci->dev.kobj.name, edac_debugfs);
if (!d)
return -ENOMEM;
parent = d;
Expand All @@ -930,6 +950,7 @@ int edac_create_debug_nodes(struct mem_ctl_info *mci)
if (!d)
goto nomem;

mci->debugfs = parent;
return 0;
nomem:
debugfs_remove(mci->debugfs);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/edac/edac_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ static int __init edac_init(void)
if (err)
goto error;

edac_debugfs_init();

/* Setup/Initialize the workq for this core */
err = edac_workqueue_setup();
if (err) {
Expand All @@ -118,6 +120,7 @@ static void __exit edac_exit(void)
/* tear down the various subsystems */
edac_workqueue_teardown();
edac_mc_sysfs_exit();
edac_debugfs_exit();
}

/*
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/edac/edac_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,20 @@ extern void edac_mc_reset_delay_period(int value);

extern void *edac_align_ptr(void **p, unsigned size, int n_elems);

/*
* EDAC debugfs functions
*/
#ifdef CONFIG_EDAC_DEBUG
int edac_debugfs_init(void);
void edac_debugfs_exit(void);
#else
static inline int edac_debugfs_init(void)
{
return -ENODEV;
}
static inline void edac_debugfs_exit(void) {}
#endif

/*
* EDAC PCI functions
*/
Expand Down

0 comments on commit 0cf89be

Please sign in to comment.