aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThor Thayer <[email protected]>2016-03-21 11:01:41 -0500
committerBorislav Petkov <[email protected]>2016-03-29 10:17:32 +0200
commit27439a1a632d9936159863fb11f5bc4d55eaab04 (patch)
tree322dc421bf01792fc6e750bab8f281ee63ed78bd
parent328ca7ae81dd842ff56b35f1e8422e6af1c80c14 (diff)
EDAC, altera: Abstract ECC Enable Mask in check_deps()
In preparation for the Arria10 peripheral ECCs, use the ECC Enable mask in place of hard coded masks in the check dependency functions. Signed-off-by: Thor Thayer <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: linux-edac <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Borislav Petkov <[email protected]>
-rw-r--r--drivers/edac/altera_edac.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c
index e20a045cbf20..0dbfa473f853 100644
--- a/drivers/edac/altera_edac.c
+++ b/drivers/edac/altera_edac.c
@@ -859,7 +859,9 @@ static void ocram_free_mem(void *p, size_t size, void *other)
static int altr_ocram_check_deps(struct altr_edac_device_dev *device)
{
void __iomem *base = device->base;
- if (readl(base) & ALTR_OCR_ECC_EN)
+ const struct edac_device_prv_data *prv = device->data;
+
+ if (readl(base) & prv->ecc_enable_mask)
return 0;
edac_printk(KERN_ERR, EDAC_DEVICE,
@@ -926,7 +928,10 @@ static void l2_free_mem(void *p, size_t size, void *other)
static int altr_l2_check_deps(struct altr_edac_device_dev *device)
{
void __iomem *base = device->base;
- if (readl(base) & ALTR_L2_ECC_EN)
+ const struct edac_device_prv_data *prv = device->data;
+
+ if ((readl(base) & prv->ecc_enable_mask) ==
+ prv->ecc_enable_mask)
return 0;
edac_printk(KERN_ERR, EDAC_DEVICE,