Commit 25b223dd authored by Thor Thayer's avatar Thor Thayer Committed by Borislav Petkov

EDAC, altera: Fix peripheral warnings for Cyclone5

The peripherals' RAS functionality only exist on the Arria10 SoCFPGA.
The Cyclone5 initialization generates EDAC warnings when the peripherals
aren't found in the device tree. Fix by checking for Arria10 in the init
functions.
Signed-off-by: default avatarThor Thayer <thor.thayer@linux.intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/1491415262-5018-1-git-send-email-thor.thayer@linux.intel.comSigned-off-by: default avatarBorislav Petkov <bp@suse.de>
parent 621c4fe3
...@@ -1023,13 +1023,23 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask, ...@@ -1023,13 +1023,23 @@ altr_init_a10_ecc_block(struct device_node *np, u32 irq_mask,
return ret; return ret;
} }
static int socfpga_is_a10(void)
{
return of_machine_is_compatible("altr,socfpga-arria10");
}
static int validate_parent_available(struct device_node *np); static int validate_parent_available(struct device_node *np);
static const struct of_device_id altr_edac_a10_device_of_match[]; static const struct of_device_id altr_edac_a10_device_of_match[];
static int __init __maybe_unused altr_init_a10_ecc_device_type(char *compat) static int __init __maybe_unused altr_init_a10_ecc_device_type(char *compat)
{ {
int irq; int irq;
struct device_node *child, *np = of_find_compatible_node(NULL, NULL, struct device_node *child, *np;
"altr,socfpga-a10-ecc-manager");
if (!socfpga_is_a10())
return -ENODEV;
np = of_find_compatible_node(NULL, NULL,
"altr,socfpga-a10-ecc-manager");
if (!np) { if (!np) {
edac_printk(KERN_ERR, EDAC_DEVICE, "ECC Manager not found\n"); edac_printk(KERN_ERR, EDAC_DEVICE, "ECC Manager not found\n");
return -ENODEV; return -ENODEV;
...@@ -1545,8 +1555,12 @@ static const struct edac_device_prv_data a10_sdmmceccb_data = { ...@@ -1545,8 +1555,12 @@ static const struct edac_device_prv_data a10_sdmmceccb_data = {
static int __init socfpga_init_sdmmc_ecc(void) static int __init socfpga_init_sdmmc_ecc(void)
{ {
int rc = -ENODEV; int rc = -ENODEV;
struct device_node *child = of_find_compatible_node(NULL, NULL, struct device_node *child;
"altr,socfpga-sdmmc-ecc");
if (!socfpga_is_a10())
return -ENODEV;
child = of_find_compatible_node(NULL, NULL, "altr,socfpga-sdmmc-ecc");
if (!child) { if (!child) {
edac_printk(KERN_WARNING, EDAC_DEVICE, "SDMMC node not found\n"); edac_printk(KERN_WARNING, EDAC_DEVICE, "SDMMC node not found\n");
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment