Skip to content

Commit

Permalink
EDAC, i5100: Convert to debugfs wrappers
Browse files Browse the repository at this point in the history
This driver creates its debugfs hierarchy under the toplevel debugfs dir
- see i5100_init() - so make it use edac_debugfs_create_dir_at( , NULL)
because we're not breaking userspace. Oh well.

Signed-off-by: Borislav Petkov <[email protected]>
  • Loading branch information
suryasaimadhu committed Sep 22, 2015
1 parent bba3b31 commit 52019e4
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions drivers/edac/i5100_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <linux/debugfs.h>

#include "edac_core.h"
#include "edac_module.h"

/* register addresses */

Expand Down Expand Up @@ -966,25 +967,25 @@ static int i5100_setup_debugfs(struct mem_ctl_info *mci)
if (!i5100_debugfs)
return -ENODEV;

priv->debugfs = debugfs_create_dir(mci->bus->name, i5100_debugfs);
priv->debugfs = edac_debugfs_create_dir_at(mci->bus->name, i5100_debugfs);

if (!priv->debugfs)
return -ENOMEM;

debugfs_create_x8("inject_channel", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_channel);
debugfs_create_x8("inject_hlinesel", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_hlinesel);
debugfs_create_x8("inject_deviceptr1", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_deviceptr1);
debugfs_create_x8("inject_deviceptr2", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_deviceptr2);
debugfs_create_x16("inject_eccmask1", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_eccmask1);
debugfs_create_x16("inject_eccmask2", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_eccmask2);
debugfs_create_file("inject_enable", S_IWUSR, priv->debugfs,
&mci->dev, &i5100_inject_enable_fops);
edac_debugfs_create_x8("inject_channel", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_channel);
edac_debugfs_create_x8("inject_hlinesel", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_hlinesel);
edac_debugfs_create_x8("inject_deviceptr1", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_deviceptr1);
edac_debugfs_create_x8("inject_deviceptr2", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_deviceptr2);
edac_debugfs_create_x16("inject_eccmask1", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_eccmask1);
edac_debugfs_create_x16("inject_eccmask2", S_IRUGO | S_IWUSR, priv->debugfs,
&priv->inject_eccmask2);
edac_debugfs_create_file("inject_enable", S_IWUSR, priv->debugfs,
&mci->dev, &i5100_inject_enable_fops);

return 0;

Expand Down Expand Up @@ -1189,7 +1190,7 @@ static void i5100_remove_one(struct pci_dev *pdev)

priv = mci->pvt_info;

debugfs_remove_recursive(priv->debugfs);
edac_debugfs_remove_recursive(priv->debugfs);

priv->scrub_enable = 0;
cancel_delayed_work_sync(&(priv->i5100_scrubbing));
Expand Down Expand Up @@ -1223,15 +1224,15 @@ static int __init i5100_init(void)
{
int pci_rc;

i5100_debugfs = debugfs_create_dir("i5100_edac", NULL);
i5100_debugfs = edac_debugfs_create_dir_at("i5100_edac", NULL);

pci_rc = pci_register_driver(&i5100_driver);
return (pci_rc < 0) ? pci_rc : 0;
}

static void __exit i5100_exit(void)
{
debugfs_remove(i5100_debugfs);
edac_debugfs_remove(i5100_debugfs);

pci_unregister_driver(&i5100_driver);
}
Expand Down

0 comments on commit 52019e4

Please sign in to comment.