diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-04-16 14:11:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-28 18:13:46 -0400 |
commit | 94d933745928ad6d8c40da89b4d0ccb2511578fc (patch) | |
tree | 47ba4be151f10c9652a3822e1c694e7b5759b5ef | |
parent | f34575aca9ea92bf61e428fb4584d9ebbff9807c (diff) |
ppc4xx_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: Josh Boyer <jwboyer@gmail.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/edac/ppc4xx_edac.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index 95cfc0f8d46d..59f50b6f21d3 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c | |||
@@ -727,7 +727,10 @@ ppc4xx_edac_handle_ce(struct mem_ctl_info *mci, | |||
727 | 727 | ||
728 | for (row = 0; row < mci->nr_csrows; row++) | 728 | for (row = 0; row < mci->nr_csrows; row++) |
729 | if (ppc4xx_edac_check_bank_error(status, row)) | 729 | if (ppc4xx_edac_check_bank_error(status, row)) |
730 | edac_mc_handle_ce_no_info(mci, message); | 730 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, |
731 | 0, 0, 0, | ||
732 | row, 0, -1, | ||
733 | message, "", NULL); | ||
731 | } | 734 | } |
732 | 735 | ||
733 | /** | 736 | /** |
@@ -755,7 +758,10 @@ ppc4xx_edac_handle_ue(struct mem_ctl_info *mci, | |||
755 | 758 | ||
756 | for (row = 0; row < mci->nr_csrows; row++) | 759 | for (row = 0; row < mci->nr_csrows; row++) |
757 | if (ppc4xx_edac_check_bank_error(status, row)) | 760 | if (ppc4xx_edac_check_bank_error(status, row)) |
758 | edac_mc_handle_ue(mci, page, offset, row, message); | 761 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
762 | page, offset, 0, | ||
763 | row, 0, -1, | ||
764 | message, "", NULL); | ||
759 | } | 765 | } |
760 | 766 | ||
761 | /** | 767 | /** |
@@ -1233,6 +1239,7 @@ static int __devinit ppc4xx_edac_probe(struct platform_device *op) | |||
1233 | dcr_host_t dcr_host; | 1239 | dcr_host_t dcr_host; |
1234 | const struct device_node *np = op->dev.of_node; | 1240 | const struct device_node *np = op->dev.of_node; |
1235 | struct mem_ctl_info *mci = NULL; | 1241 | struct mem_ctl_info *mci = NULL; |
1242 | struct edac_mc_layer layers[2]; | ||
1236 | static int ppc4xx_edac_instance; | 1243 | static int ppc4xx_edac_instance; |
1237 | 1244 | ||
1238 | /* | 1245 | /* |
@@ -1278,12 +1285,14 @@ static int __devinit ppc4xx_edac_probe(struct platform_device *op) | |||
1278 | * controller instance and perform the appropriate | 1285 | * controller instance and perform the appropriate |
1279 | * initialization. | 1286 | * initialization. |
1280 | */ | 1287 | */ |
1281 | 1288 | layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; | |
1282 | mci = edac_mc_alloc(sizeof(struct ppc4xx_edac_pdata), | 1289 | layers[0].size = ppc4xx_edac_nr_csrows; |
1283 | ppc4xx_edac_nr_csrows, | 1290 | layers[0].is_virt_csrow = true; |
1284 | ppc4xx_edac_nr_chans, | 1291 | layers[1].type = EDAC_MC_LAYER_CHANNEL; |
1285 | ppc4xx_edac_instance); | 1292 | layers[1].size = ppc4xx_edac_nr_chans; |
1286 | 1293 | layers[1].is_virt_csrow = false; | |
1294 | mci = new_edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, | ||
1295 | sizeof(struct ppc4xx_edac_pdata)); | ||
1287 | if (mci == NULL) { | 1296 | if (mci == NULL) { |
1288 | ppc4xx_edac_printk(KERN_ERR, "%s: " | 1297 | ppc4xx_edac_printk(KERN_ERR, "%s: " |
1289 | "Failed to allocate EDAC MC instance!\n", | 1298 | "Failed to allocate EDAC MC instance!\n", |