diff options
author | Madalin Bucur <madalin.bucur@freescale.com> | 2014-07-25 07:08:34 (GMT) |
---|---|---|
committer | Madalin Bucur <madalin.bucur@freescale.com> | 2015-02-25 16:26:53 (GMT) |
commit | 7eb361ffc4e115a17b182ec08c35bd86a64cc17f (patch) | |
tree | 06593b170619bd99fc6edf7f07ab0c6e0c3aca10 /drivers | |
parent | 35dcf9ee7734ab2e79658174b69a0d580b679125 (diff) | |
download | linux-fsl-qoriq-7eb361ffc4e115a17b182ec08c35bd86a64cc17f.tar.xz |
dpaa_eth: move debugfs initialization in generic module
Initialize debugfs from the DPAA generic driver.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Change-Id: I032589647a56a6704b4044078a8468ca786149fc
Reviewed-on: http://git.am.freescale.net:8181/15295
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Cristian Bercaru <cristian.bercaru@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.h | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c | 8 |
3 files changed, 17 insertions, 12 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c index 21d177a..2713acb 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.c @@ -66,9 +66,9 @@ MODULE_LICENSE("Dual BSD/GPL"); MODULE_DESCRIPTION(DPA_GENERIC_DESCRIPTION); -static uint8_t debug = -1; -module_param(debug, byte, S_IRUGO); -MODULE_PARM_DESC(debug, "Module/Driver verbosity level"); +static uint8_t generic_debug = -1; +module_param(generic_debug, byte, S_IRUGO); +MODULE_PARM_DESC(generic_debug, "Module/Driver verbosity level"); /* This has to work in tandem with the DPA_CS_THRESHOLD_xxx values. */ static uint16_t tx_timeout = 1000; @@ -1439,7 +1439,7 @@ static int dpa_generic_eth_probe(struct platform_device *_of_dev) priv = netdev_priv(netdev); priv->net_dev = netdev; sprintf(priv->if_type, "generic%d", generic_idx++); - priv->msg_enable = netif_msg_init(debug, -1); + priv->msg_enable = netif_msg_init(generic_debug, -1); priv->tx_headroom = DPA_DEFAULT_TX_HEADROOM; init_timer(&priv->timer); @@ -1530,6 +1530,10 @@ static int __init __cold dpa_generic_load(void) KBUILD_BASENAME".c", __LINE__, __func__, _errno); } +#ifdef CONFIG_FSL_DPAA_ETH_DEBUGFS + dpa_generic_debugfs_module_init(); +#endif /* CONFIG_FSL_DPAA_ETH_DEBUGFS */ + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", KBUILD_BASENAME".c", __func__); @@ -1548,6 +1552,10 @@ static void __exit __cold dpa_generic_unload(void) platform_driver_unregister(&dpa_generic_driver); +#ifdef CONFIG_FSL_DPAA_ETH_DEBUGFS + dpa_generic_debugfs_module_exit(); +#endif /* CONFIG_FSL_DPAA_ETH_DEBUGFS */ + pr_debug(KBUILD_MODNAME ": %s:%s() ->\n", KBUILD_BASENAME".c", __func__); } diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.h b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.h index 606812f..7070896 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.h +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth_generic.h @@ -84,10 +84,11 @@ struct dpa_generic_priv_s { struct timer_list timer; }; +extern const struct ethtool_ops dpa_generic_ethtool_ops; void dpaa_eth_generic_sysfs_init(struct device *dev); void dpaa_eth_generic_sysfs_remove(struct device *dev); - -extern const struct ethtool_ops dpa_generic_ethtool_ops; +int __init dpa_generic_debugfs_module_init(void); +void __exit dpa_generic_debugfs_module_exit(void); #endif /* __DPA_ETH_GENERIC_H */ diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c b/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c index 6ab1ade..79a6a96 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_generic_debugfs.c @@ -254,7 +254,7 @@ void dpa_generic_debugfs_remove(struct net_device *net_dev) debugfs_remove(priv->debugfs_file); } -static int __init dpa_generic_debugfs_module_init(void) +int __init dpa_generic_debugfs_module_init(void) { int _errno = 0; @@ -273,11 +273,7 @@ static int __init dpa_generic_debugfs_module_init(void) return _errno; } -static void __exit dpa_generic_debugfs_module_exit(void) +void __exit dpa_generic_debugfs_module_exit(void) { debugfs_remove(dpa_debugfs_root); } - -module_init(dpa_generic_debugfs_module_init); -module_exit(dpa_generic_debugfs_module_exit); -MODULE_LICENSE("Dual BSD/GPL"); |