diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-16 14:05:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:11:00 -0400 |
commit | d8c34af4d064c14686839119bd161628264c2819 (patch) | |
tree | 06f706f5b5e6bb9bb104e6a627e5512d95818cbd /drivers/edac/amd76x_edac.c | |
parent | ab5a503cb57c1acea3b67210f46ebc2cfb28945e (diff) |
amd76x_edac: convert driver to use the new edac ABI
The legacy edac ABI is going to be removed. Port the driver to use
and benefit from the new API functionality.
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/amd76x_edac.c')
-rw-r--r-- | drivers/edac/amd76x_edac.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/drivers/edac/amd76x_edac.c b/drivers/edac/amd76x_edac.c index a2dde205f651..69f2b2ebb263 100644 --- a/drivers/edac/amd76x_edac.c +++ b/drivers/edac/amd76x_edac.c | |||
@@ -29,7 +29,6 @@ | |||
29 | edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg) | 29 | edac_mc_chipset_printk(mci, level, "amd76x", fmt, ##arg) |
30 | 30 | ||
31 | #define AMD76X_NR_CSROWS 8 | 31 | #define AMD76X_NR_CSROWS 8 |
32 | #define AMD76X_NR_CHANS 1 | ||
33 | #define AMD76X_NR_DIMMS 4 | 32 | #define AMD76X_NR_DIMMS 4 |
34 | 33 | ||
35 | /* AMD 76x register addresses - device 0 function 0 - PCI bridge */ | 34 | /* AMD 76x register addresses - device 0 function 0 - PCI bridge */ |
@@ -146,8 +145,10 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci, | |||
146 | 145 | ||
147 | if (handle_errors) { | 146 | if (handle_errors) { |
148 | row = (info->ecc_mode_status >> 4) & 0xf; | 147 | row = (info->ecc_mode_status >> 4) & 0xf; |
149 | edac_mc_handle_ue(mci, mci->csrows[row].first_page, 0, | 148 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
150 | row, mci->ctl_name); | 149 | mci->csrows[row].first_page, 0, 0, |
150 | row, 0, -1, | ||
151 | mci->ctl_name, "", NULL); | ||
151 | } | 152 | } |
152 | } | 153 | } |
153 | 154 | ||
@@ -159,8 +160,10 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci, | |||
159 | 160 | ||
160 | if (handle_errors) { | 161 | if (handle_errors) { |
161 | row = info->ecc_mode_status & 0xf; | 162 | row = info->ecc_mode_status & 0xf; |
162 | edac_mc_handle_ce(mci, mci->csrows[row].first_page, 0, | 163 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, |
163 | 0, row, 0, mci->ctl_name); | 164 | mci->csrows[row].first_page, 0, 0, |
165 | row, 0, -1, | ||
166 | mci->ctl_name, "", NULL); | ||
164 | } | 167 | } |
165 | } | 168 | } |
166 | 169 | ||
@@ -232,7 +235,8 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) | |||
232 | EDAC_SECDED, | 235 | EDAC_SECDED, |
233 | EDAC_SECDED | 236 | EDAC_SECDED |
234 | }; | 237 | }; |
235 | struct mem_ctl_info *mci = NULL; | 238 | struct mem_ctl_info *mci; |
239 | struct edac_mc_layer layers[2]; | ||
236 | u32 ems; | 240 | u32 ems; |
237 | u32 ems_mode; | 241 | u32 ems_mode; |
238 | struct amd76x_error_info discard; | 242 | struct amd76x_error_info discard; |
@@ -240,11 +244,17 @@ static int amd76x_probe1(struct pci_dev *pdev, int dev_idx) | |||
240 | debugf0("%s()\n", __func__); | 244 | debugf0("%s()\n", __func__); |
241 | pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems); | 245 | pci_read_config_dword(pdev, AMD76X_ECC_MODE_STATUS, &ems); |
242 | ems_mode = (ems >> 10) & 0x3; | 246 | ems_mode = (ems >> 10) & 0x3; |
243 | mci = edac_mc_alloc(0, AMD76X_NR_CSROWS, AMD76X_NR_CHANS, 0); | ||
244 | 247 | ||
245 | if (mci == NULL) { | 248 | layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; |
249 | layers[0].size = AMD76X_NR_CSROWS; | ||
250 | layers[0].is_virt_csrow = true; | ||
251 | layers[1].type = EDAC_MC_LAYER_CHANNEL; | ||
252 | layers[1].size = 1; | ||
253 | layers[1].is_virt_csrow = false; | ||
254 | mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0); | ||
255 | |||
256 | if (mci == NULL) | ||
246 | return -ENOMEM; | 257 | return -ENOMEM; |
247 | } | ||
248 | 258 | ||
249 | debugf0("%s(): mci = %p\n", __func__, mci); | 259 | debugf0("%s(): mci = %p\n", __func__, mci); |
250 | mci->dev = &pdev->dev; | 260 | mci->dev = &pdev->dev; |