From 76e1f486b2e6775bba31118b362e01ea6033a0e6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 24 Aug 2013 10:24:40 -0700 Subject: [PATCH] staging: wlags49_h2: remove sysfs file The sysfs file in this driver is showing a raft of debugging values, none of which belong in sysfs, let alone in a single sysfs file. If these really need to be described somewhere, they should go into debugfs. For now, just delete the sysfs file, which removes a bunch of files from the tree. Cc: Henk de Groot Signed-off-by: Greg Kroah-Hartman --- drivers/staging/wlags49_h2/Makefile | 2 - drivers/staging/wlags49_h2/wl_cs.c | 4 - drivers/staging/wlags49_h2/wl_internal.h | 1 - drivers/staging/wlags49_h2/wl_sysfs.c | 138 ------------------------------- drivers/staging/wlags49_h2/wl_sysfs.h | 7 -- drivers/staging/wlags49_h25/Makefile | 3 - drivers/staging/wlags49_h25/wl_sysfs.c | 2 - drivers/staging/wlags49_h25/wl_sysfs.h | 2 - 8 files changed, 159 deletions(-) delete mode 100644 drivers/staging/wlags49_h2/wl_sysfs.c delete mode 100644 drivers/staging/wlags49_h2/wl_sysfs.h delete mode 100644 drivers/staging/wlags49_h25/wl_sysfs.c delete mode 100644 drivers/staging/wlags49_h25/wl_sysfs.h diff --git a/drivers/staging/wlags49_h2/Makefile b/drivers/staging/wlags49_h2/Makefile index 31e1d89..6eeb5d1 100644 --- a/drivers/staging/wlags49_h2/Makefile +++ b/drivers/staging/wlags49_h2/Makefile @@ -51,5 +51,3 @@ $(WLNAME)-y += wl_profile.o \ mmd.o \ hcf.o \ dhf.o - -$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index b55dc43..a458705 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -99,7 +99,6 @@ #include #include #include -#include /******************************************************************************* @@ -178,7 +177,6 @@ static void wl_adapter_detach(struct pcmcia_device *link) wl_adapter_release(link); if (dev) { - unregister_wlags_sysfs(dev); unregister_netdev(dev); wl_device_dealloc(dev); } @@ -265,8 +263,6 @@ int wl_adapter_insert(struct pcmcia_device *link) goto failed; } - register_wlags_sysfs(dev); - printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, mac_address" " %pM\n", dev->name, dev->base_addr, dev->irq, dev->dev_addr); diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h index b230781..78129e9 100644 --- a/drivers/staging/wlags49_h2/wl_internal.h +++ b/drivers/staging/wlags49_h2/wl_internal.h @@ -883,7 +883,6 @@ struct wl_private int is_registered; int is_handling_int; int firmware_present; - bool sysfsCreated; CFG_DRV_INFO_STRCT driverInfo; CFG_IDENTITY_STRCT driverIdentity; CFG_FW_IDENTITY_STRCT StationIdentity; diff --git a/drivers/staging/wlags49_h2/wl_sysfs.c b/drivers/staging/wlags49_h2/wl_sysfs.c deleted file mode 100644 index 1508f04..0000000 --- a/drivers/staging/wlags49_h2/wl_sysfs.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * ex: sw=4 - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -static inline int dev_isalive(const struct net_device *dev) -{ - return dev->reg_state == NETREG_REGISTERED; -} - -/* - * empirically even if tallies are defined as 32 bits entities, only - * high 16 bits are relevant; low half is always zero. It means tallies - * are pretty much useless for traffic counting but at least give overview - * about where error come from - */ -static ssize_t show_tallies(struct device *d, struct device_attribute *attr, - char *buf) -{ - struct net_device *dev = to_net_dev(d); - struct wl_private *lp = wl_priv(dev); - unsigned long flags; - CFG_HERMES_TALLIES_STRCT tallies; - ssize_t ret = -EINVAL; - - rcu_read_lock(); - if (dev_isalive(dev)) { - wl_lock(lp, &flags); - - ret = wl_get_tallies(lp, &tallies); - if (ret == 0) { - wl_unlock(lp, &flags); - ret = snprintf(buf, PAGE_SIZE, - "TxUnicastFrames: %u\n" - "TxMulticastFrames: %u\n" - "TxFragments: %u\n" - "TxUnicastOctets: %u\n" - "TxMulticastOctets: %u\n" - "TxDeferredTransmissions: %u\n" - "TxSingleRetryFrames: %u\n" - "TxMultipleRetryFrames: %u\n" - "TxRetryLimitExceeded: %u\n" - "TxDiscards: %u\n" - "RxUnicastFrames: %u\n" - "RxMulticastFrames: %u\n" - "RxFragments: %u\n" - "RxUnicastOctets: %u\n" - "RxMulticastOctets: %u\n" - "RxFCSErrors: %u\n" - "RxDiscardsNoBuffer: %u\n" - "TxDiscardsWrongSA: %u\n" - "RxWEPUndecryptable: %u\n" - "RxMsgInMsgFragments: %u\n" - "RxMsgInBadMsgFragments: %u\n" - "RxDiscardsWEPICVError: %u\n" - "RxDiscardsWEPExcluded: %u\n" - , - (unsigned int)tallies.TxUnicastFrames, - (unsigned int)tallies.TxMulticastFrames, - (unsigned int)tallies.TxFragments, - (unsigned int)tallies.TxUnicastOctets, - (unsigned int)tallies.TxMulticastOctets, - (unsigned int)tallies.TxDeferredTransmissions, - (unsigned int)tallies.TxSingleRetryFrames, - (unsigned int)tallies.TxMultipleRetryFrames, - (unsigned int)tallies.TxRetryLimitExceeded, - (unsigned int)tallies.TxDiscards, - (unsigned int)tallies.RxUnicastFrames, - (unsigned int)tallies.RxMulticastFrames, - (unsigned int)tallies.RxFragments, - (unsigned int)tallies.RxUnicastOctets, - (unsigned int)tallies.RxMulticastOctets, - (unsigned int)tallies.RxFCSErrors, - (unsigned int)tallies.RxDiscardsNoBuffer, - (unsigned int)tallies.TxDiscardsWrongSA, - (unsigned int)tallies.RxWEPUndecryptable, - (unsigned int)tallies.RxMsgInMsgFragments, - (unsigned int)tallies.RxMsgInBadMsgFragments, - (unsigned int)tallies.RxDiscardsWEPICVError, - (unsigned int)tallies.RxDiscardsWEPExcluded); - } else { - wl_unlock( lp, &flags ); - } - } - - rcu_read_unlock(); - return ret; -} - -static DEVICE_ATTR(tallies, S_IRUGO, show_tallies, NULL); - -static struct attribute *wlags_attrs[] = { - &dev_attr_tallies.attr, - NULL -}; - -static struct attribute_group wlags_group = { - .name = "wlags", - .attrs = wlags_attrs, -}; - -void register_wlags_sysfs(struct net_device *net) -{ - struct device *dev = &(net->dev); - struct wl_private *lp = wl_priv(net); - int err; - err = sysfs_create_group(&dev->kobj, &wlags_group); - if (!err) - lp->sysfsCreated = true; -} - -void unregister_wlags_sysfs(struct net_device *net) -{ - struct device *dev = &(net->dev); - struct wl_private *lp = wl_priv(net); - - if (lp->sysfsCreated) - sysfs_remove_group(&dev->kobj, &wlags_group); -} diff --git a/drivers/staging/wlags49_h2/wl_sysfs.h b/drivers/staging/wlags49_h2/wl_sysfs.h deleted file mode 100644 index fa658c3..0000000 --- a/drivers/staging/wlags49_h2/wl_sysfs.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef CONFIG_SYSFS -extern void register_wlags_sysfs(struct net_device *); -extern void unregister_wlags_sysfs(struct net_device *); -#else -static inline void register_wlags_sysfs(struct net_device *net) { } -static inline void unregister_wlags_sysfs(struct net_device *net) { } -#endif diff --git a/drivers/staging/wlags49_h25/Makefile b/drivers/staging/wlags49_h25/Makefile index 6e0159d..513ba01 100644 --- a/drivers/staging/wlags49_h25/Makefile +++ b/drivers/staging/wlags49_h25/Makefile @@ -50,6 +50,3 @@ $(WLNAME)-y += wl_profile.o \ mmd.o \ hcf.o \ dhf.o - -$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o - diff --git a/drivers/staging/wlags49_h25/wl_sysfs.c b/drivers/staging/wlags49_h25/wl_sysfs.c deleted file mode 100644 index 6458ee6..0000000 --- a/drivers/staging/wlags49_h25/wl_sysfs.c +++ /dev/null @@ -1,2 +0,0 @@ -/* Use common source from wlags49_h2 */ -#include "../wlags49_h2/wl_sysfs.c" diff --git a/drivers/staging/wlags49_h25/wl_sysfs.h b/drivers/staging/wlags49_h25/wl_sysfs.h deleted file mode 100644 index eb819a5..0000000 --- a/drivers/staging/wlags49_h25/wl_sysfs.h +++ /dev/null @@ -1,2 +0,0 @@ -/* Use common source from wlags49_h2 */ -#include "../wlags49_h2/wl_sysfs.h" -- 2.7.4