aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
diff options
context:
space:
mode:
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 8899e105da9f..590e95b4cbfa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -42,7 +42,6 @@
42#include <linux/dma-mapping.h> 42#include <linux/dma-mapping.h>
43#include <linux/slab.h> 43#include <linux/slab.h>
44#include <linux/prefetch.h> 44#include <linux/prefetch.h>
45#include <linux/pci.h>
46#ifdef CONFIG_STMMAC_DEBUG_FS 45#ifdef CONFIG_STMMAC_DEBUG_FS
47#include <linux/debugfs.h> 46#include <linux/debugfs.h>
48#include <linux/seq_file.h> 47#include <linux/seq_file.h>
@@ -2093,25 +2092,29 @@ int stmmac_restore(struct net_device *ndev)
2093} 2092}
2094#endif /* CONFIG_PM */ 2093#endif /* CONFIG_PM */
2095 2094
2095/* Driver can be configured w/ and w/ both PCI and Platf drivers
2096 * depending on the configuration selected.
2097 */
2096static int __init stmmac_init(void) 2098static int __init stmmac_init(void)
2097{ 2099{
2098 int err = 0; 2100 int err_plt = 0;
2101 int err_pci = 0;
2099 2102
2100 err = platform_driver_register(&stmmac_pltfr_driver); 2103 err_plt = stmmac_register_platform();
2104 err_pci = stmmac_register_pci();
2101 2105
2102 if (!err) { 2106 if ((err_pci) && (err_plt)) {
2103 err = pci_register_driver(&stmmac_pci_driver); 2107 pr_err("stmmac: driver registration failed\n");
2104 if (err) 2108 return -EINVAL;
2105 platform_driver_unregister(&stmmac_pltfr_driver);
2106 } 2109 }
2107 2110
2108 return err; 2111 return 0;
2109} 2112}
2110 2113
2111static void __exit stmmac_exit(void) 2114static void __exit stmmac_exit(void)
2112{ 2115{
2113 pci_unregister_driver(&stmmac_pci_driver); 2116 stmmac_unregister_platform();
2114 platform_driver_unregister(&stmmac_pltfr_driver); 2117 stmmac_unregister_pci();
2115} 2118}
2116 2119
2117module_init(stmmac_init); 2120module_init(stmmac_init);