diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-04 11:48:52 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-02-23 13:07:41 +0100 |
commit | 4e8d230de9c1dff8e587ae769e46fcddb3d98f1c (patch) | |
tree | 3a94888ddd239d04aab3ff1458cd3f3f4afa08f3 /drivers/edac/edac_mc_sysfs.c | |
parent | EDAC: Use static attribute groups for managing sysfs entries (diff) | |
download | linux-4e8d230de9c1dff8e587ae769e46fcddb3d98f1c.tar.xz linux-4e8d230de9c1dff8e587ae769e46fcddb3d98f1c.zip |
EDAC: Allow to pass driver-specific attribute groups
Add edac_mc_add_mc_with_groups() for initializing the mem_ctl_info
object with the optional attribute groups. This allows drivers to
pass additional sysfs entries without manual (and racy)
device_create_file() and co calls.
edac_mc_add_mc() is kept as is, just calling edac_mc_add_with_groups()
with NULL groups.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: http://lkml.kernel.org/r/1423046938-18111-3-git-send-email-tiwai@suse.de
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/edac_mc_sysfs.c')
-rw-r--r-- | drivers/edac/edac_mc_sysfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c index 0bcd64234a03..3a283819970b 100644 --- a/drivers/edac/edac_mc_sysfs.c +++ b/drivers/edac/edac_mc_sysfs.c @@ -974,7 +974,8 @@ nomem: * 0 Success * !0 Failure */ -int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) +int edac_create_sysfs_mci_device(struct mem_ctl_info *mci, + const struct attribute_group **groups) { int i, err; @@ -998,6 +999,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) mci->dev.parent = mci_pdev; mci->dev.bus = mci->bus; + mci->dev.groups = groups; dev_set_name(&mci->dev, "mc%d", mci->mc_idx); dev_set_drvdata(&mci->dev, mci); pm_runtime_forbid(&mci->dev); |