Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287589

[PATCH] edac: Don't call mpc85xx_pci_err_probe() from fsl_pci_probe()

From Johannes Thumshirn <jthumshirn@suse.de>
Newsgroups linux.kernel
Subject [PATCH] edac: Don't call mpc85xx_pci_err_probe() from fsl_pci_probe()
Date 2015-12-09 17:00 +0100
Message-ID <qDPjP-1RQ-3@gated-at.bofh.it> (permalink)
References <qDKka-7aE-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Don't call mpc85xx_pci_err_probe() from fsl_pci_probe() but instantiate the
PCI EDAC driver via the OpenFirmware interface.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
---

Patch is untested due to lack of hardware and against Boris' for-next branch,
please test.
Thanks,
	Johannes


 arch/powerpc/sysdev/fsl_pci.c |  2 --
 arch/powerpc/sysdev/fsl_pci.h |  9 ---------
 drivers/edac/mpc85xx_edac.c   | 35 +++++++++++++++++++++++++++++++++--
 3 files changed, 33 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 610f472..5c59037 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -1263,8 +1263,6 @@ static int fsl_pci_probe(struct platform_device *pdev)
 	node = pdev->dev.of_node;
 	ret = fsl_add_bridge(pdev, fsl_pci_primary == node);
 
-	mpc85xx_pci_err_probe(pdev);
-
 	return 0;
 }
 
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index c1cec77..1515885 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -130,15 +130,6 @@ void fsl_pci_assign_primary(void);
 static inline void fsl_pci_assign_primary(void) {}
 #endif
 
-#ifdef CONFIG_EDAC_MPC85XX
-int mpc85xx_pci_err_probe(struct platform_device *op);
-#else
-static inline int mpc85xx_pci_err_probe(struct platform_device *op)
-{
-	return -ENOTSUPP;
-}
-#endif
-
 #ifdef CONFIG_FSL_PCI
 extern int fsl_pci_mcheck_exception(struct pt_regs *);
 #else
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 3eab063..c6fc8d5 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -238,7 +238,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-int mpc85xx_pci_err_probe(struct platform_device *op)
+static int mpc85xx_pci_err_probe(struct platform_device *op)
 {
 	struct edac_pci_ctl_info *pci;
 	struct mpc85xx_pci_pdata *pdata;
@@ -386,7 +386,37 @@ err:
 	devres_release_group(&op->dev, mpc85xx_pci_err_probe);
 	return res;
 }
-EXPORT_SYMBOL(mpc85xx_pci_err_probe);
+
+static const struct of_device_id mpc85xx_pci_err_of_match[] = {
+	{ .compatible = "fsl,mpc8540-pci", },
+	{ .compatible = "fsl,mpc8548-pcie", },
+	{ .compatible = "fsl,mpc8610-pci", },
+	{ .compatible = "fsl,mpc8641-pcie", },
+	{ .compatible = "fsl,qoriq-pcie", },
+	{ .compatible = "fsl,qoriq-pcie-v2.1", },
+	{ .compatible = "fsl,qoriq-pcie-v2.2", },
+	{ .compatible = "fsl,qoriq-pcie-v2.3", },
+	{ .compatible = "fsl,qoriq-pcie-v2.4", },
+	{ .compatible = "fsl,qoriq-pcie-v3.0", },
+
+	/*
+	 * The following entries are for compatibility with older device
+	 * trees.
+	 */
+	{ .compatible = "fsl,p1022-pcie", },
+	{ .compatible = "fsl,p4080-pcie", },
+
+	{},
+};
+MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
+
+static struct platform_driver mpc85xx_pci_err_driver = {
+	.driver = {
+		.name = "mpc85xx_edac_pci",
+		.of_match_table = mpc85xx_pci_err_of_match,
+	},
+	.probe = mpc85xx_pci_err_probe,
+};
 
 #endif				/* CONFIG_PCI */
 
@@ -1211,6 +1241,7 @@ static void __init mpc85xx_mc_clear_rfxe(void *data)
 static struct platform_driver * const drivers[] = {
 	&mpc85xx_mc_err_driver,
 	&mpc85xx_l2_err_driver,
+	&mpc85xx_pci_err_driver,
 };
 
 static int __init mpc85xx_mc_init(void)
-- 
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

linux-next: Tree for Dec 8 Stephen Rothwell <sfr@canb.auug.org.au> - 2015-12-08 05:50 +0100
  Crash caused by "EDAC: Rip out the edac_subsys reference counting"  (was Re: linux-next: Tree for Dec 8) Michael Ellerman <mpe@ellerman.id.au> - 2015-12-09 11:40 +0100
    Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Borislav Petkov <bp@suse.de> - 2015-12-09 12:20 +0100
      Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Borislav Petkov <bp@suse.de> - 2015-12-09 17:10 +0100
        Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Scott Wood <scottwood@freescale.com> - 2015-12-09 18:00 +0100
          Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Borislav Petkov <bp@suse.de> - 2015-12-09 18:40 +0100
            Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Scott Wood <scottwood@freescale.com> - 2015-12-09 19:00 +0100
              Re: Crash caused by "EDAC: Rip out the edac_subsys reference  counting" (was Re: linux-next: Tree for Dec 8) Borislav Petkov <bp@suse.de> - 2015-12-09 20:30 +0100
    [PATCH] edac: Don't call mpc85xx_pci_err_probe() from fsl_pci_probe() Johannes Thumshirn <jthumshirn@suse.de> - 2015-12-09 17:00 +0100

csiph-web