summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-13 04:59:18 (GMT)
committerDavid S. Miller <davem@davemloft.net>2012-06-13 04:59:18 (GMT)
commit43b03f1f6d6832d744918947d185a7aee89d1e0f (patch)
tree53a8c47d67dfcd23450d4068d08ccf2b7714c5e8 /drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
parent2da45db2bdd432a9dca825099c791f5c851f92b9 (diff)
parent5ee31c6898ea5537fcea160999d60dc63bc0c305 (diff)
downloadlinux-fsl-qoriq-43b03f1f6d6832d744918947d185a7aee89d1e0f.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: MAINTAINERS drivers/net/wireless/iwlwifi/pcie/trans.c The iwlwifi conflict was resolved by keeping the code added in 'net' that turns off the buggy chip feature. The MAINTAINERS conflict was merely overlapping changes, one change updated all the wireless web site URLs and the other changed some GIT trees to be Johannes's instead of John's. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/stmicro/stmmac/stmmac_main.c')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 8899e10..590e95b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -42,7 +42,6 @@
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/prefetch.h>
-#include <linux/pci.h>
#ifdef CONFIG_STMMAC_DEBUG_FS
#include <linux/debugfs.h>
#include <linux/seq_file.h>
@@ -2093,25 +2092,29 @@ int stmmac_restore(struct net_device *ndev)
}
#endif /* CONFIG_PM */
+/* Driver can be configured w/ and w/ both PCI and Platf drivers
+ * depending on the configuration selected.
+ */
static int __init stmmac_init(void)
{
- int err = 0;
+ int err_plt = 0;
+ int err_pci = 0;
- err = platform_driver_register(&stmmac_pltfr_driver);
+ err_plt = stmmac_register_platform();
+ err_pci = stmmac_register_pci();
- if (!err) {
- err = pci_register_driver(&stmmac_pci_driver);
- if (err)
- platform_driver_unregister(&stmmac_pltfr_driver);
+ if ((err_pci) && (err_plt)) {
+ pr_err("stmmac: driver registration failed\n");
+ return -EINVAL;
}
- return err;
+ return 0;
}
static void __exit stmmac_exit(void)
{
- pci_unregister_driver(&stmmac_pci_driver);
- platform_driver_unregister(&stmmac_pltfr_driver);
+ stmmac_unregister_platform();
+ stmmac_unregister_pci();
}
module_init(stmmac_init);