video: rockchip: vop: 3399: add property for hwc layer
[firefly-linux-kernel-4.4.55.git] / drivers / edac / highbank_l2_edac.c
index 10d3d298b640c4ceb720e2d5331b26d306cdd1b9..2f193668ebc75b7a75d4eb9ceebaa5f89a1eaba8 100644 (file)
@@ -50,8 +50,15 @@ static irqreturn_t highbank_l2_err_handler(int irq, void *dev_id)
        return IRQ_HANDLED;
 }
 
+static const struct of_device_id hb_l2_err_of_match[] = {
+       { .compatible = "calxeda,hb-sregs-l2-ecc", },
+       {},
+};
+MODULE_DEVICE_TABLE(of, hb_l2_err_of_match);
+
 static int highbank_l2_err_probe(struct platform_device *pdev)
 {
+       const struct of_device_id *id;
        struct edac_device_ctl_info *dci;
        struct hb_l2_drvdata *drvdata;
        struct resource *r;
@@ -90,7 +97,9 @@ static int highbank_l2_err_probe(struct platform_device *pdev)
                goto err;
        }
 
-       dci->mod_name = dev_name(&pdev->dev);
+       id = of_match_device(hb_l2_err_of_match, &pdev->dev);
+       dci->mod_name = pdev->dev.driver->name;
+       dci->ctl_name = id ? id->compatible : "unknown";
        dci->dev_name = dev_name(&pdev->dev);
 
        if (edac_device_add_device(dci))
@@ -129,12 +138,6 @@ static int highbank_l2_err_remove(struct platform_device *pdev)
        return 0;
 }
 
-static const struct of_device_id hb_l2_err_of_match[] = {
-       { .compatible = "calxeda,hb-sregs-l2-ecc", },
-       {},
-};
-MODULE_DEVICE_TABLE(of, hb_l2_err_of_match);
-
 static struct platform_driver highbank_l2_edac_driver = {
        .probe = highbank_l2_err_probe,
        .remove = highbank_l2_err_remove,