Commit ca0907b9e413bb1d1f3ea123b663535b74928846

Authored by Mauro Carvalho Chehab
1 parent e2acc357ee

edac: Remove the legacy EDAC ABI

Now that all drivers got converted to use the new ABI, we can
drop the old one.

Acked-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 27 changed files with 32 additions and 151 deletions Side-by-side Diff

drivers/edac/amd64_edac.c
... ... @@ -2596,7 +2596,7 @@
2596 2596 layers[1].type = EDAC_MC_LAYER_CHANNEL;
2597 2597 layers[1].size = pvt->channel_count;
2598 2598 layers[1].is_virt_csrow = false;
2599   - mci = new_edac_mc_alloc(nid, ARRAY_SIZE(layers), layers, 0);
  2599 + mci = edac_mc_alloc(nid, ARRAY_SIZE(layers), layers, 0);
2600 2600 if (!mci)
2601 2601 goto err_siblings;
2602 2602  
drivers/edac/amd76x_edac.c
... ... @@ -251,7 +251,7 @@
251 251 layers[1].type = EDAC_MC_LAYER_CHANNEL;
252 252 layers[1].size = 1;
253 253 layers[1].is_virt_csrow = false;
254   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  254 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
255 255  
256 256 if (mci == NULL)
257 257 return -ENOMEM;
drivers/edac/cell_edac.c
... ... @@ -204,7 +204,7 @@
204 204 layers[1].type = EDAC_MC_LAYER_CHANNEL;
205 205 layers[1].size = num_chans;
206 206 layers[1].is_virt_csrow = false;
207   - mci = new_edac_mc_alloc(pdev->id, ARRAY_SIZE(layers), layers,
  207 + mci = edac_mc_alloc(pdev->id, ARRAY_SIZE(layers), layers,
208 208 sizeof(struct cell_edac_priv));
209 209 if (mci == NULL)
210 210 return -ENOMEM;
drivers/edac/cpc925_edac.c
... ... @@ -982,7 +982,7 @@
982 982 layers[1].type = EDAC_MC_LAYER_CHANNEL;
983 983 layers[1].size = nr_channels;
984 984 layers[1].is_virt_csrow = false;
985   - mci = new_edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
  985 + mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
986 986 sizeof(struct cpc925_mc_pdata));
987 987 if (!mci) {
988 988 cpc925_printk(KERN_ERR, "No memory for mem_ctl_info\n");
drivers/edac/e752x_edac.c
... ... @@ -1278,8 +1278,7 @@
1278 1278 layers[1].type = EDAC_MC_LAYER_CHANNEL;
1279 1279 layers[1].size = drc_chan + 1;
1280 1280 layers[1].is_virt_csrow = false;
1281   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
1282   - sizeof(*pvt));
  1281 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1283 1282 if (mci == NULL)
1284 1283 return -ENOMEM;
1285 1284  
drivers/edac/e7xxx_edac.c
... ... @@ -447,7 +447,7 @@
447 447 layers[1].type = EDAC_MC_LAYER_CHANNEL;
448 448 layers[1].size = drc_chan + 1;
449 449 layers[1].is_virt_csrow = false;
450   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
  450 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
451 451 if (mci == NULL)
452 452 return -ENOMEM;
453 453  
drivers/edac/edac_core.h
... ... @@ -447,9 +447,7 @@
447 447  
448 448 #endif /* CONFIG_PCI */
449 449  
450   -struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
451   - unsigned nr_chans, int edac_index);
452   -struct mem_ctl_info *new_edac_mc_alloc(unsigned edac_index,
  450 +struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
453 451 unsigned n_layers,
454 452 struct edac_mc_layer *layers,
455 453 unsigned sz_pvt);
... ... @@ -460,18 +458,6 @@
460 458 extern struct mem_ctl_info *edac_mc_del_mc(struct device *dev);
461 459 extern int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci,
462 460 unsigned long page);
463   -
464   -/*
465   - * The no info errors are used when error overflows are reported.
466   - * There are a limited number of error logging registers that can
467   - * be exausted. When all registers are exhausted and an additional
468   - * error occurs then an error overflow register records that an
469   - * error occurred and the type of error, but doesn't have any
470   - * further information. The ce/ue versions make for cleaner
471   - * reporting logic and function interface - reduces conditional
472   - * statement clutter and extra function arguments.
473   - */
474   -
475 461 void edac_mc_handle_error(const enum hw_event_mc_err_type type,
476 462 struct mem_ctl_info *mci,
477 463 const unsigned long page_frame_number,
... ... @@ -483,66 +469,6 @@
483 469 const char *msg,
484 470 const char *other_detail,
485 471 const void *mcelog);
486   -
487   -static inline void edac_mc_handle_ce(struct mem_ctl_info *mci,
488   - unsigned long page_frame_number,
489   - unsigned long offset_in_page,
490   - unsigned long syndrome, int row, int channel,
491   - const char *msg)
492   -{
493   - edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci,
494   - page_frame_number, offset_in_page, syndrome,
495   - row, channel, -1, msg, NULL, NULL);
496   -}
497   -
498   -static inline void edac_mc_handle_ce_no_info(struct mem_ctl_info *mci,
499   - const char *msg)
500   -{
501   - edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci,
502   - 0, 0, 0, -1, -1, -1, msg, NULL, NULL);
503   -}
504   -
505   -static inline void edac_mc_handle_ue(struct mem_ctl_info *mci,
506   - unsigned long page_frame_number,
507   - unsigned long offset_in_page, int row,
508   - const char *msg)
509   -{
510   - edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
511   - page_frame_number, offset_in_page, 0,
512   - row, -1, -1, msg, NULL, NULL);
513   -}
514   -
515   -static inline void edac_mc_handle_ue_no_info(struct mem_ctl_info *mci,
516   - const char *msg)
517   -{
518   - edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
519   - 0, 0, 0, -1, -1, -1, msg, NULL, NULL);
520   -}
521   -
522   -static inline void edac_mc_handle_fbd_ue(struct mem_ctl_info *mci,
523   - unsigned int csrow,
524   - unsigned int channel0,
525   - unsigned int channel1,
526   - char *msg)
527   -{
528   - /*
529   - *FIXME: The error can also be at channel1 (e. g. at the second
530   - * channel of the same branch). The fix is to push
531   - * edac_mc_handle_error() call into each driver
532   - */
533   - edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci,
534   - 0, 0, 0,
535   - csrow, channel0, -1, msg, NULL, NULL);
536   -}
537   -
538   -static inline void edac_mc_handle_fbd_ce(struct mem_ctl_info *mci,
539   - unsigned int csrow,
540   - unsigned int channel, char *msg)
541   -{
542   - edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci,
543   - 0, 0, 0,
544   - csrow, channel, -1, msg, NULL, NULL);
545   -}
546 472  
547 473 /*
548 474 * edac_device APIs
drivers/edac/edac_mc.c
... ... @@ -195,13 +195,13 @@
195 195 * on such scenarios, as grouping the multiple ranks require drivers change.
196 196 *
197 197 * Returns:
198   - * NULL allocation failed
199   - * struct mem_ctl_info pointer
  198 + * On failure: NULL
  199 + * On success: struct mem_ctl_info pointer
200 200 */
201   -struct mem_ctl_info *new_edac_mc_alloc(unsigned mc_num,
202   - unsigned n_layers,
203   - struct edac_mc_layer *layers,
204   - unsigned sz_pvt)
  201 +struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
  202 + unsigned n_layers,
  203 + struct edac_mc_layer *layers,
  204 + unsigned sz_pvt)
205 205 {
206 206 struct mem_ctl_info *mci;
207 207 struct edac_mc_layer *layer;
... ... @@ -369,46 +369,6 @@
369 369 * will occur during the kobject callback operation
370 370 */
371 371 return mci;
372   -}
373   -EXPORT_SYMBOL_GPL(new_edac_mc_alloc);
374   -
375   -/**
376   - * edac_mc_alloc: Allocate and partially fill a struct mem_ctl_info structure
377   - * @mc_num: Memory controller number
378   - * @n_layers: Number of layers at the MC hierarchy
379   - * layers: Describes each layer as seen by the Memory Controller
380   - * @size_pvt: Size of private storage needed
381   - *
382   - *
383   - * FIXME: drivers handle multi-rank memories in different ways: some
384   - * drivers map multi-ranked DIMMs as one DIMM while others
385   - * as several DIMMs.
386   - *
387   - * Everything is kmalloc'ed as one big chunk - more efficient.
388   - * It can only be used if all structures have the same lifetime - otherwise
389   - * you have to allocate and initialize your own structures.
390   - *
391   - * Use edac_mc_free() to free mc structures allocated by this function.
392   - *
393   - * Returns:
394   - * On failure: NULL
395   - * On success: struct mem_ctl_info pointer
396   - */
397   -
398   -struct mem_ctl_info *edac_mc_alloc(unsigned sz_pvt, unsigned nr_csrows,
399   - unsigned nr_chans, int mc_num)
400   -{
401   - unsigned n_layers = 2;
402   - struct edac_mc_layer layers[n_layers];
403   -
404   - layers[0].type = EDAC_MC_LAYER_CHIP_SELECT;
405   - layers[0].size = nr_csrows;
406   - layers[0].is_virt_csrow = true;
407   - layers[1].type = EDAC_MC_LAYER_CHANNEL;
408   - layers[1].size = nr_chans;
409   - layers[1].is_virt_csrow = false;
410   -
411   - return new_edac_mc_alloc(mc_num, ARRAY_SIZE(layers), layers, sz_pvt);
412 372 }
413 373 EXPORT_SYMBOL_GPL(edac_mc_alloc);
414 374  
drivers/edac/i3000_edac.c
... ... @@ -362,7 +362,7 @@
362 362 layers[1].type = EDAC_MC_LAYER_CHANNEL;
363 363 layers[1].size = nr_channels;
364 364 layers[1].is_virt_csrow = false;
365   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  365 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
366 366 if (!mci)
367 367 return -ENOMEM;
368 368  
drivers/edac/i3200_edac.c
... ... @@ -347,7 +347,7 @@
347 347 layers[1].type = EDAC_MC_LAYER_CHANNEL;
348 348 layers[1].size = nr_channels;
349 349 layers[1].is_virt_csrow = false;
350   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
  350 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
351 351 sizeof(struct i3200_priv));
352 352 if (!mci)
353 353 return -ENOMEM;
drivers/edac/i5000_edac.c
... ... @@ -1396,8 +1396,7 @@
1396 1396 layers[2].type = EDAC_MC_LAYER_SLOT;
1397 1397 layers[2].size = num_dimms_per_channel;
1398 1398 layers[2].is_virt_csrow = true;
1399   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1400   -
  1399 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1401 1400 if (mci == NULL)
1402 1401 return -ENOMEM;
1403 1402  
drivers/edac/i5100_edac.c
... ... @@ -936,7 +936,7 @@
936 936 layers[1].type = EDAC_MC_LAYER_SLOT;
937 937 layers[1].size = ranksperch;
938 938 layers[1].is_virt_csrow = true;
939   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
  939 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers,
940 940 sizeof(*priv));
941 941 if (!mci) {
942 942 ret = -ENOMEM;
drivers/edac/i5400_edac.c
... ... @@ -1280,8 +1280,7 @@
1280 1280 layers[2].type = EDAC_MC_LAYER_SLOT;
1281 1281 layers[2].size = DIMMS_PER_CHANNEL;
1282 1282 layers[2].is_virt_csrow = true;
1283   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1284   -
  1283 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1285 1284 if (mci == NULL)
1286 1285 return -ENOMEM;
1287 1286  
drivers/edac/i7300_edac.c
... ... @@ -1051,8 +1051,7 @@
1051 1051 layers[2].type = EDAC_MC_LAYER_SLOT;
1052 1052 layers[2].size = MAX_SLOTS;
1053 1053 layers[2].is_virt_csrow = true;
1054   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1055   -
  1054 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
1056 1055 if (mci == NULL)
1057 1056 return -ENOMEM;
1058 1057  
drivers/edac/i7core_edac.c
... ... @@ -2147,7 +2147,7 @@
2147 2147 layers[1].type = EDAC_MC_LAYER_SLOT;
2148 2148 layers[1].size = MAX_DIMMS;
2149 2149 layers[1].is_virt_csrow = true;
2150   - mci = new_edac_mc_alloc(i7core_dev->socket, ARRAY_SIZE(layers), layers,
  2150 + mci = edac_mc_alloc(i7core_dev->socket, ARRAY_SIZE(layers), layers,
2151 2151 sizeof(*pvt));
2152 2152 if (unlikely(!mci))
2153 2153 return -ENOMEM;
drivers/edac/i82443bxgx_edac.c
... ... @@ -255,7 +255,7 @@
255 255 layers[1].type = EDAC_MC_LAYER_CHANNEL;
256 256 layers[1].size = I82443BXGX_NR_CHANS;
257 257 layers[1].is_virt_csrow = false;
258   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  258 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
259 259 if (mci == NULL)
260 260 return -ENOMEM;
261 261  
drivers/edac/i82860_edac.c
... ... @@ -206,7 +206,7 @@
206 206 layers[1].type = EDAC_MC_LAYER_SLOT;
207 207 layers[1].size = 8;
208 208 layers[1].is_virt_csrow = true;
209   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  209 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
210 210 if (!mci)
211 211 return -ENOMEM;
212 212  
drivers/edac/i82875p_edac.c
... ... @@ -420,7 +420,7 @@
420 420 layers[1].type = EDAC_MC_LAYER_CHANNEL;
421 421 layers[1].size = nr_chans;
422 422 layers[1].is_virt_csrow = false;
423   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
  423 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
424 424 if (!mci) {
425 425 rc = -ENOMEM;
426 426 goto fail0;
drivers/edac/i82975x_edac.c
... ... @@ -555,7 +555,7 @@
555 555 layers[1].type = EDAC_MC_LAYER_CHANNEL;
556 556 layers[1].size = I82975X_NR_CSROWS(chans);
557 557 layers[1].is_virt_csrow = false;
558   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
  558 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, sizeof(*pvt));
559 559 if (!mci) {
560 560 rc = -ENOMEM;
561 561 goto fail1;
drivers/edac/mpc85xx_edac.c
... ... @@ -980,8 +980,7 @@
980 980 layers[1].type = EDAC_MC_LAYER_CHANNEL;
981 981 layers[1].size = 1;
982 982 layers[1].is_virt_csrow = false;
983   - mci = new_edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
984   - sizeof(*pdata));
  983 + mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), sizeof(*pdata));
985 984 if (!mci) {
986 985 devres_release_group(&op->dev, mpc85xx_mc_err_probe);
987 986 return -ENOMEM;
drivers/edac/mv64x60_edac.c
... ... @@ -715,7 +715,7 @@
715 715 layers[1].type = EDAC_MC_LAYER_CHANNEL;
716 716 layers[1].size = 1;
717 717 layers[1].is_virt_csrow = false;
718   - mci = new_edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
  718 + mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
719 719 sizeof(struct mv64x60_mc_pdata));
720 720 if (!mci) {
721 721 printk(KERN_ERR "%s: No memory for CPU err\n", __func__);
drivers/edac/pasemi_edac.c
... ... @@ -215,7 +215,7 @@
215 215 layers[1].type = EDAC_MC_LAYER_CHANNEL;
216 216 layers[1].size = PASEMI_EDAC_NR_CHANS;
217 217 layers[1].is_virt_csrow = false;
218   - mci = new_edac_mc_alloc(system_mmc_id++, ARRAY_SIZE(layers), layers,
  218 + mci = edac_mc_alloc(system_mmc_id++, ARRAY_SIZE(layers), layers,
219 219 0);
220 220 if (mci == NULL)
221 221 return -ENOMEM;
drivers/edac/ppc4xx_edac.c
... ... @@ -1291,7 +1291,7 @@
1291 1291 layers[1].type = EDAC_MC_LAYER_CHANNEL;
1292 1292 layers[1].size = ppc4xx_edac_nr_chans;
1293 1293 layers[1].is_virt_csrow = false;
1294   - mci = new_edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers,
  1294 + mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers,
1295 1295 sizeof(struct ppc4xx_edac_pdata));
1296 1296 if (mci == NULL) {
1297 1297 ppc4xx_edac_printk(KERN_ERR, "%s: "
drivers/edac/r82600_edac.c
... ... @@ -291,7 +291,7 @@
291 291 layers[1].type = EDAC_MC_LAYER_CHANNEL;
292 292 layers[1].size = R82600_NR_CHANS;
293 293 layers[1].is_virt_csrow = false;
294   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  294 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
295 295 if (mci == NULL)
296 296 return -ENOMEM;
297 297  
drivers/edac/sb_edac.c
... ... @@ -1640,7 +1640,7 @@
1640 1640 layers[1].type = EDAC_MC_LAYER_SLOT;
1641 1641 layers[1].size = MAX_DIMMS;
1642 1642 layers[1].is_virt_csrow = true;
1643   - mci = new_edac_mc_alloc(sbridge_dev->mc, ARRAY_SIZE(layers), layers,
  1643 + mci = edac_mc_alloc(sbridge_dev->mc, ARRAY_SIZE(layers), layers,
1644 1644 sizeof(*pvt));
1645 1645  
1646 1646 if (unlikely(!mci))
drivers/edac/tile_edac.c
... ... @@ -141,7 +141,7 @@
141 141 layers[1].type = EDAC_MC_LAYER_CHANNEL;
142 142 layers[1].size = TILE_EDAC_NR_CHANS;
143 143 layers[1].is_virt_csrow = false;
144   - mci = new_edac_mc_alloc(pdev->id, ARRAY_SIZE(layers), layers,
  144 + mci = edac_mc_alloc(pdev->id, ARRAY_SIZE(layers), layers,
145 145 sizeof(struct tile_edac_priv));
146 146 if (mci == NULL)
147 147 return -ENOMEM;
drivers/edac/x38_edac.c
... ... @@ -348,7 +348,7 @@
348 348 layers[1].type = EDAC_MC_LAYER_CHANNEL;
349 349 layers[1].size = x38_channel_num;
350 350 layers[1].is_virt_csrow = false;
351   - mci = new_edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
  351 + mci = edac_mc_alloc(0, ARRAY_SIZE(layers), layers, 0);
352 352 if (!mci)
353 353 return -ENOMEM;
354 354