All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jia Hongtao <B38951@freescale.com>
To: <linuxppc-dev@lists.ozlabs.org>, <galak@kernel.crashing.org>,
	<B07421@freescale.com>
Cc: b38951@freescale.com
Subject: [PATCH 6/6] Edac/85xx: Register mpc85xx_pci_err_driver by fsl_pci_driver
Date: Tue, 24 Jul 2012 18:20:10 +0800	[thread overview]
Message-ID: <1343125210-16720-6-git-send-email-B38951@freescale.com> (raw)
In-Reply-To: <1343125210-16720-1-git-send-email-B38951@freescale.com>

From: Chunhe Lan <Chunhe.Lan@freescale.com>

Now we registered pci controllers as platform devices. It will make edac
driver failed to register pci nodes as platform devices too. So we combine
two initialization code as one platform driver.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Jia Hongtao <B38951@freescale.com>
---
 arch/powerpc/sysdev/fsl_pci.c |    4 +++
 arch/powerpc/sysdev/fsl_pci.h |    4 +++
 drivers/edac/mpc85xx_edac.c   |   43 +++++++++++-----------------------------
 3 files changed, 20 insertions(+), 31 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index a14ee6f..5bc8222 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -962,6 +962,10 @@ static int __devinit fsl_pci_probe(struct platform_device *pdev)
 	if (of_match_node(pci_ids, pdev->dev.of_node))
 		fsl_add_bridge(pdev->dev.of_node, is_primary);
 
+#ifdef CONFIG_EDAC_MPC85XX
+	mpc85xx_pci_err_probe(pdev);
+#endif
+
 	return 0;
 }
 
diff --git a/arch/powerpc/sysdev/fsl_pci.h b/arch/powerpc/sysdev/fsl_pci.h
index abbc09d..1dfe85d 100644
--- a/arch/powerpc/sysdev/fsl_pci.h
+++ b/arch/powerpc/sysdev/fsl_pci.h
@@ -110,5 +110,9 @@ extern void pci_check_swiotlb(void);
 static inline void pci_check_swiotlb(void) {}
 #endif
 
+#ifdef CONFIG_EDAC_MPC85XX
+extern int mpc85xx_pci_err_probe(struct platform_device *op);
+#endif
+
 #endif /* __POWERPC_FSL_PCI_H */
 #endif /* __KERNEL__ */
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 0e37462..e4b6113 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -200,7 +200,7 @@ static irqreturn_t mpc85xx_pci_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
+int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
 {
 	struct edac_pci_ctl_info *pci;
 	struct mpc85xx_pci_pdata *pdata;
@@ -214,6 +214,16 @@ static int __devinit mpc85xx_pci_err_probe(struct platform_device *op)
 	if (!pci)
 		return -ENOMEM;
 
+	/* make sure error reporting method is sane */
+	switch (edac_op_state) {
+	case EDAC_OPSTATE_POLL:
+	case EDAC_OPSTATE_INT:
+		break;
+	default:
+		edac_op_state = EDAC_OPSTATE_INT;
+		break;
+	}
+
 	pdata = pci->pvt_info;
 	pdata->name = "mpc85xx_pci_err";
 	pdata->irq = NO_IRQ;
@@ -303,6 +313,7 @@ err:
 	devres_release_group(&op->dev, mpc85xx_pci_err_probe);
 	return res;
 }
+EXPORT_SYMBOL(mpc85xx_pci_err_probe);
 
 static int mpc85xx_pci_err_remove(struct platform_device *op)
 {
@@ -326,27 +337,6 @@ static int mpc85xx_pci_err_remove(struct platform_device *op)
 	return 0;
 }
 
-static struct of_device_id mpc85xx_pci_err_of_match[] = {
-	{
-	 .compatible = "fsl,mpc8540-pcix",
-	 },
-	{
-	 .compatible = "fsl,mpc8540-pci",
-	},
-	{},
-};
-MODULE_DEVICE_TABLE(of, mpc85xx_pci_err_of_match);
-
-static struct platform_driver mpc85xx_pci_err_driver = {
-	.probe = mpc85xx_pci_err_probe,
-	.remove = __devexit_p(mpc85xx_pci_err_remove),
-	.driver = {
-		.name = "mpc85xx_pci_err",
-		.owner = THIS_MODULE,
-		.of_match_table = mpc85xx_pci_err_of_match,
-	},
-};
-
 #endif				/* CONFIG_PCI */
 
 /**************************** L2 Err device ***************************/
@@ -1193,12 +1183,6 @@ static int __init mpc85xx_mc_init(void)
 	if (res)
 		printk(KERN_WARNING EDAC_MOD_STR "L2 fails to register\n");
 
-#ifdef CONFIG_PCI
-	res = platform_driver_register(&mpc85xx_pci_err_driver);
-	if (res)
-		printk(KERN_WARNING EDAC_MOD_STR "PCI fails to register\n");
-#endif
-
 #ifdef CONFIG_FSL_SOC_BOOKE
 	pvr = mfspr(SPRN_PVR);
 
@@ -1235,9 +1219,6 @@ static void __exit mpc85xx_mc_exit(void)
 		on_each_cpu(mpc85xx_mc_restore_hid1, NULL, 0);
 	}
 #endif
-#ifdef CONFIG_PCI
-	platform_driver_unregister(&mpc85xx_pci_err_driver);
-#endif
 	platform_driver_unregister(&mpc85xx_l2_err_driver);
 	platform_driver_unregister(&mpc85xx_mc_err_driver);
 }
-- 
1.7.5.1

  parent reply	other threads:[~2012-07-24 10:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24 10:20 [PATCH 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Jia Hongtao
2012-07-24 10:20 ` [PATCH 2/6] powerpc/fsl-pci: Check swiotlb enable at board setup_arch stage Jia Hongtao
2012-07-24 10:20 ` [PATCH 3/6] powerpc/fsl-pci: Determine primary bus by looking for ISA node Jia Hongtao
2012-07-24 18:47   ` Scott Wood
2012-07-25  2:42     ` Jia Hongtao-B38951
2012-07-25 17:25       ` Scott Wood
2012-07-26  2:20         ` Jia Hongtao-B38951
2012-07-27  1:34           ` Scott Wood
2012-07-27  2:07             ` Jia Hongtao-B38951
2012-07-27 16:37               ` Scott Wood
2012-07-25  9:01     ` Jia Hongtao-B38951
2012-07-25 17:27       ` Scott Wood
2012-07-24 10:20 ` [PATCH 4/6] powerpc/mpc85xx_ds: convert to unified PCI init Jia Hongtao
2012-07-24 10:20 ` [PATCH 5/6] powerpc/fsl-pci: Add pci inbound/outbound PM support Jia Hongtao
2012-07-27 13:24   ` Kumar Gala
2012-07-30  6:09     ` Jia Hongtao-B38951
2012-07-31 13:37       ` Kumar Gala
2012-08-02 11:35         ` Jia Hongtao-B38951
2012-08-07 10:11         ` Jia Hongtao-B38951
2012-08-07 15:34           ` Scott Wood
2012-08-07 17:34             ` Kumar Gala
2012-08-08  3:07               ` Jia Hongtao-B38951
2012-08-08  9:54             ` Jia Hongtao-B38951
2012-08-08 12:46               ` Kumar Gala
2012-08-08 21:04                 ` Scott Wood
2012-08-09 10:32                   ` Jia Hongtao-B38951
2012-08-09  2:52                 ` Jia Hongtao-B38951
2012-08-09  5:05                   ` Li Yang
2012-08-09 13:08                     ` Kumar Gala
2012-08-10  2:17                       ` Jia Hongtao-B38951
2012-07-24 10:20 ` Jia Hongtao [this message]
2012-07-24 18:42 ` [PATCH 1/6] powerpc/fsl-pci: Unify pci/pcie initialization code Scott Wood
2012-07-25  2:35   ` Jia Hongtao-B38951
2012-07-25 17:23     ` Scott Wood
2012-07-26  2:09       ` Jia Hongtao-B38951
2012-07-26  2:38       ` Jia Hongtao-B38951

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1343125210-16720-6-git-send-email-B38951@freescale.com \
    --to=b38951@freescale.com \
    --cc=B07421@freescale.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.