rtl8366_smi: add Kconfig option for the debugfs stuff

SVN-Revision: 19243
This commit is contained in:
Gabor Juhos 2010-01-20 09:30:36 +00:00
parent 0d48b043b1
commit 5e5451a54d
7 changed files with 29 additions and 10 deletions

View file

@ -185,6 +185,7 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set # CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set # CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set

View file

@ -190,6 +190,7 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set # CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set # CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set

View file

@ -193,6 +193,7 @@ CONFIG_PHYLIB=y
# CONFIG_PROBE_INITRD_HEADER is not set # CONFIG_PROBE_INITRD_HEADER is not set
CONFIG_RTL8306_PHY=y CONFIG_RTL8306_PHY=y
CONFIG_RTL8366_SMI=y CONFIG_RTL8366_SMI=y
# CONFIG_RTL8366_SMI_DEBUG_FS is not set
CONFIG_SCHED_OMIT_FRAME_POINTER=y CONFIG_SCHED_OMIT_FRAME_POINTER=y
# CONFIG_SCSI_DMA is not set # CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250_EXTENDED is not set # CONFIG_SERIAL_8250_EXTENDED is not set

View file

@ -21,9 +21,7 @@
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/rtl8366_smi.h> #include <linux/rtl8366_smi.h>
/* #define DEBUG 1 */ #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
#ifdef DEBUG
#include <linux/debugfs.h> #include <linux/debugfs.h>
#endif #endif
@ -210,12 +208,12 @@ struct rtl8366_smi {
struct switch_dev dev; struct switch_dev dev;
int mii_irq[PHY_MAX_ADDR]; int mii_irq[PHY_MAX_ADDR];
char buf[4096]; char buf[4096];
#ifdef DEBUG #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
struct dentry *debugfs_root; struct dentry *debugfs_root;
#endif #endif
}; };
#ifdef DEBUG #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
u16 g_dbg_reg; u16 g_dbg_reg;
#endif #endif
@ -972,7 +970,7 @@ static int rtl8366s_reset_vlan(struct rtl8366_smi *smi)
return 0; return 0;
} }
#ifdef DEBUG #ifdef CONFIG_RTL8366_SMI_DEBUG_FS
static int rtl8366_debugfs_open(struct inode *inode, struct file *file) static int rtl8366_debugfs_open(struct inode *inode, struct file *file)
{ {
file->private_data = inode->i_private; file->private_data = inode->i_private;
@ -1197,7 +1195,7 @@ static void rtl8366_debugfs_remove(struct rtl8366_smi *smi)
#else #else
static inline void rtl8366_debugfs_init(struct rtl8366_smi *smi) {} static inline void rtl8366_debugfs_init(struct rtl8366_smi *smi) {}
static inline void rtl8366_debugfs_remove(struct rtl8366_smi *smi) {} static inline void rtl8366_debugfs_remove(struct rtl8366_smi *smi) {}
#endif #endif /* CONFIG_RTL8366_SMI_DEBUG_FS */
static int rtl8366_global_reset_mibs(struct switch_dev *dev, static int rtl8366_global_reset_mibs(struct switch_dev *dev,
const struct switch_attr *attr, const struct switch_attr *attr,

View file

@ -1,12 +1,18 @@
--- a/drivers/net/phy/Kconfig --- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig
@@ -140,4 +140,8 @@ config MDIO_GPIO @@ -140,4 +140,14 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called mdio-gpio. will be called mdio-gpio.
+config RTL8366_SMI +config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface" + tristate "Support for RTL8366 switch via SMI interface"
+ depends on GENERIC_GPIO + depends on GENERIC_GPIO
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+ depends on DEBUG_FS
+ default n
+ +
endif # PHYLIB endif # PHYLIB
--- a/drivers/net/phy/Makefile --- a/drivers/net/phy/Makefile

View file

@ -1,12 +1,18 @@
--- a/drivers/net/phy/Kconfig --- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig
@@ -140,4 +140,8 @@ config MDIO_GPIO @@ -140,4 +140,14 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called mdio-gpio. will be called mdio-gpio.
+config RTL8366_SMI +config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface" + tristate "Support for RTL8366 switch via SMI interface"
+ depends on GENERIC_GPIO + depends on GENERIC_GPIO
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+ depends on DEBUG_FS
+ default n
+ +
endif # PHYLIB endif # PHYLIB
--- a/drivers/net/phy/Makefile --- a/drivers/net/phy/Makefile

View file

@ -1,12 +1,18 @@
--- a/drivers/net/phy/Kconfig --- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig
@@ -146,4 +146,8 @@ config MDIO_GPIO @@ -146,4 +146,14 @@ config MDIO_GPIO
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called mdio-gpio. will be called mdio-gpio.
+config RTL8366_SMI +config RTL8366_SMI
+ tristate "Support for RTL8366 switch via SMI interface" + tristate "Support for RTL8366 switch via SMI interface"
+ depends on GENERIC_GPIO + depends on GENERIC_GPIO
+
+config RTL8366_SMI_DEBUG_FS
+ bool "RTL8366S driver DEBUG_FS support"
+ depends on RTL8366_SMI
+ depends on DEBUG_FS
+ default n
+ +
endif # PHYLIB endif # PHYLIB
--- a/drivers/net/phy/Makefile --- a/drivers/net/phy/Makefile