diff options
author | Takashi Iwai <tiwai@suse.de> | 2015-02-04 05:48:58 -0500 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2015-02-23 07:12:22 -0500 |
commit | fc7cc6b7820b54119821a3c6838ff583d796a2ab (patch) | |
tree | 839c9dace6a7314b2b3923b988da1fa58945798d /drivers/edac | |
parent | 1bf06a0d55a5d3e19b6da970d7194d6067f4204b (diff) |
EDAC: highbank: Use static attribute groups for sysfs entries
... instead of manual device_create_file() and device_remove_file()
calls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: http://lkml.kernel.org/r/1423046938-18111-9-git-send-email-tiwai@suse.de
Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/highbank_mc_edac.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/edac/highbank_mc_edac.c b/drivers/edac/highbank_mc_edac.c index f784de1dc793..475484718fb2 100644 --- a/drivers/edac/highbank_mc_edac.c +++ b/drivers/edac/highbank_mc_edac.c | |||
@@ -124,6 +124,13 @@ static ssize_t highbank_mc_inject_ctrl(struct device *dev, | |||
124 | 124 | ||
125 | static DEVICE_ATTR(inject_ctrl, S_IWUSR, NULL, highbank_mc_inject_ctrl); | 125 | static DEVICE_ATTR(inject_ctrl, S_IWUSR, NULL, highbank_mc_inject_ctrl); |
126 | 126 | ||
127 | static struct attribute *highbank_dev_attrs[] = { | ||
128 | &dev_attr_inject_ctrl.attr, | ||
129 | NULL | ||
130 | }; | ||
131 | |||
132 | ATTRIBUTE_GROUPS(highbank_dev); | ||
133 | |||
127 | struct hb_mc_settings { | 134 | struct hb_mc_settings { |
128 | int err_offset; | 135 | int err_offset; |
129 | int int_offset; | 136 | int int_offset; |
@@ -231,7 +238,7 @@ static int highbank_mc_probe(struct platform_device *pdev) | |||
231 | dimm->mtype = MEM_DDR3; | 238 | dimm->mtype = MEM_DDR3; |
232 | dimm->edac_mode = EDAC_SECDED; | 239 | dimm->edac_mode = EDAC_SECDED; |
233 | 240 | ||
234 | res = edac_mc_add_mc(mci); | 241 | res = edac_mc_add_mc_with_groups(mci, highbank_dev_groups); |
235 | if (res < 0) | 242 | if (res < 0) |
236 | goto err; | 243 | goto err; |
237 | 244 | ||
@@ -243,8 +250,6 @@ static int highbank_mc_probe(struct platform_device *pdev) | |||
243 | goto err2; | 250 | goto err2; |
244 | } | 251 | } |
245 | 252 | ||
246 | device_create_file(&mci->dev, &dev_attr_inject_ctrl); | ||
247 | |||
248 | devres_close_group(&pdev->dev, NULL); | 253 | devres_close_group(&pdev->dev, NULL); |
249 | return 0; | 254 | return 0; |
250 | err2: | 255 | err2: |
@@ -259,7 +264,6 @@ static int highbank_mc_remove(struct platform_device *pdev) | |||
259 | { | 264 | { |
260 | struct mem_ctl_info *mci = platform_get_drvdata(pdev); | 265 | struct mem_ctl_info *mci = platform_get_drvdata(pdev); |
261 | 266 | ||
262 | device_remove_file(&mci->dev, &dev_attr_inject_ctrl); | ||
263 | edac_mc_del_mc(&pdev->dev); | 267 | edac_mc_del_mc(&pdev->dev); |
264 | edac_mc_free(mci); | 268 | edac_mc_free(mci); |
265 | return 0; | 269 | return 0; |