staging: ft1000: remove procfs entries
authorNicolas Thery <nthery@gmail.com>
Sun, 27 Jul 2014 18:32:06 +0000 (20:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Jul 2014 18:45:46 +0000 (11:45 -0700)
This patch started as a fix to some checkpatch complaints in ft1000
procfs code but Greg suggested to remove the procfs entries altogether:

http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2014-July/055594.html

Signed-off-by: Nicolas Thery <nthery@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-pcmcia/Makefile
drivers/staging/ft1000/ft1000-pcmcia/ft1000.h
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c [deleted file]
drivers/staging/ft1000/ft1000-usb/Makefile
drivers/staging/ft1000/ft1000-usb/ft1000_proc.c [deleted file]
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c
drivers/staging/ft1000/ft1000-usb/ft1000_usb.h
drivers/staging/ft1000/ft1000.h

index 660b7a50e891b0d97b301f25217406d9ad0b4daa..715de3f00e330eec00d121b94441b40ebb797d6a 100644 (file)
@@ -1,3 +1,2 @@
 obj-$(CONFIG_FT1000_PCMCIA) = ft1000_pcmcia.o
-ft1000_pcmcia-y := ft1000_hw.o ft1000_dnld.o ft1000_proc.o ft1000_cs.o
-
+ft1000_pcmcia-y := ft1000_hw.o ft1000_dnld.o ft1000_cs.o
index 0c21ac680038475e553c522e84cf40ed8efd277d..1d52738fff49b80d03782e1cb1cc338d26b53e11 100644 (file)
@@ -47,8 +47,6 @@ extern struct net_device *init_ft1000_card(struct pcmcia_device *link,
 extern void stop_ft1000_card(struct net_device *dev);
 extern int card_download(struct net_device *dev, const u8 *pFileStart,
                         size_t FileLength);
-extern void ft1000InitProc(struct net_device *dev);
-extern void ft1000CleanupProc(struct net_device *dev);
 
 extern u16 ft1000_read_dpram(struct net_device *dev, int offset);
 extern void card_bootload(struct net_device *dev);
index a6158bef58e54c63dc19ebfcb3ef89daf2b0874e..21f09fe168e9f9256d4f3c801461c3f9d7852958 100644 (file)
@@ -19,8 +19,6 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
-#include <linux/proc_fs.h>
-
 #include <linux/sched.h>
 #include <linux/ptrace.h>
 #include <linux/slab.h>
@@ -2102,7 +2100,6 @@ void stop_ft1000_card(struct net_device *dev)
        release_region(dev->base_addr,256);
        release_firmware(fw_entry);
        flarion_ft1000_cnt--;
-       ft1000CleanupProc(dev);
 
 }
 
@@ -2247,7 +2244,6 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link,
 
        ft1000_enable_interrupts(dev);
 
-       ft1000InitProc(dev);
        ft1000_card_present = 1;
        dev->ethtool_ops = &ops;
        printk(KERN_INFO "ft1000: %s: addr 0x%04lx irq %d, MAC addr %pM\n",
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c
deleted file mode 100644 (file)
index 88f6f9c..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-/*---------------------------------------------------------------------------
-   FT1000 driver for Flarion Flash OFDM NIC Device
-
-   Copyright (C) 2006 Patrik Ostrihon, All rights reserved.
-   Copyright (C) 2006 ProWeb Consulting, a.s, All rights reserved.
-
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the Free
-   Software Foundation; either version 2 of the License, or (at your option) any
-   later version. This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
-   more details. You should have received a copy of the GNU General Public
-   License along with this program; if not, write to the
-   Free Software Foundation, Inc., 59 Temple Place -
-   Suite 330, Boston, MA 02111-1307, USA.
------------------------------------------------------------------------------*/
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/string.h>
-#include <linux/vmalloc.h>
-#include <linux/netdevice.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
-#include "ft1000.h"
-
-#define FT1000_PROC "ft1000"
-#define MAX_FILE_LEN 255
-
-#define seq_putx(m, message, size, var) \
-       seq_printf(m, message); \
-       for (i = 0; i < (size - 1); i++) { \
-               seq_printf(m, "%02x:", var[i]); \
-       } \
-       seq_printf(m, "%02x\n", var[i])
-
-#define seq_putd(m, message, size, var) \
-       seq_printf(m, message); \
-       for (i = 0; i < (size - 1); i++) { \
-               seq_printf(m, "%d.", var[i]); \
-       } \
-       seq_printf(m, "%d\n", var[i])
-
-static int ft1000ReadProc(struct seq_file *m, void *v)
-{
-       static const char *status[] = {
-               "Idle (Disconnect)", "Searching", "Active (Connected)",
-               "Waiting for L2", "Sleep", "No Coverage", "", ""
-       };
-       static const char *signal[] = { "", "*", "**", "***", "****" };
-
-       struct net_device *dev = m->private;
-       struct ft1000_info *info = netdev_priv(dev);
-       int i;
-       int strength;
-       int quality;
-       struct timeval tv;
-       time_t delta;
-
-       if (info->AsicID == ELECTRABUZZ_ID) {
-               if (info->ProgConStat != 0xFF) {
-                       info->LedStat =
-                               ft1000_read_dpram(dev, FT1000_DSP_LED);
-                       info->ConStat =
-                               ft1000_read_dpram(dev, FT1000_DSP_CON_STATE);
-               } else {
-                       info->ConStat = 0xf;
-               }
-       } else {
-               if (info->ProgConStat != 0xFF) {
-                       info->LedStat =
-                               ntohs(ft1000_read_dpram_mag_16(
-                                             dev, FT1000_MAG_DSP_LED,
-                                             FT1000_MAG_DSP_LED_INDX));
-                       info->ConStat =
-                               ntohs(ft1000_read_dpram_mag_16(
-                                             dev, FT1000_MAG_DSP_CON_STATE,
-                                             FT1000_MAG_DSP_CON_STATE_INDX));
-               } else {
-                       info->ConStat = 0xf;
-               }
-       }
-
-       i = (info->LedStat) & 0xf;
-       switch (i) {
-       case 0x1:
-               strength = 1;
-               break;
-       case 0x3:
-               strength = 2;
-               break;
-       case 0x7:
-               strength = 3;
-               break;
-       case 0xf:
-               strength = 4;
-               break;
-       default:
-               strength = 0;
-       }
-
-       i = (info->LedStat >> 8) & 0xf;
-       switch (i) {
-       case 0x1:
-               quality = 1;
-               break;
-       case 0x3:
-               quality = 2;
-               break;
-       case 0x7:
-               quality = 3;
-               break;
-       case 0xf:
-               quality = 4;
-               break;
-       default:
-               quality = 0;
-       }
-
-       do_gettimeofday(&tv);
-       delta = tv.tv_sec - info->ConTm;
-       seq_printf(m, "Connection Time: %02ld:%02ld:%02ld\n",
-                        ((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
-       seq_printf(m, "Connection Time[s]: %ld\n", delta);
-       seq_printf(m, "Asic ID: %s\n",
-                        info->AsicID ==
-                        ELECTRABUZZ_ID ? "ELECTRABUZZ ASIC" : "MAGNEMITE ASIC");
-       seq_putx(m, "SKU: ", SKUSZ, info->Sku);
-       seq_putx(m, "EUI64: ", EUISZ, info->eui64);
-       seq_putd(m, "DSP version number: ", DSPVERSZ, info->DspVer);
-       seq_putx(m, "Hardware Serial Number: ", HWSERNUMSZ, info->HwSerNum);
-       seq_putx(m, "Caliberation Version: ", CALVERSZ, info->RfCalVer);
-       seq_putd(m, "Caliberation Date: ", CALDATESZ, info->RfCalDate);
-       seq_printf(m, "Media State: %s\n",
-                        (info->mediastate) ? "link" : "no link");
-       seq_printf(m, "Connection Status: %s\n", status[info->ConStat & 0x7]);
-       seq_printf(m, "RX packets: %ld\n", info->stats.rx_packets);
-       seq_printf(m, "TX packets: %ld\n", info->stats.tx_packets);
-       seq_printf(m, "RX bytes: %ld\n", info->stats.rx_bytes);
-       seq_printf(m, "TX bytes: %ld\n", info->stats.tx_bytes);
-       seq_printf(m, "Signal Strength: %s\n", signal[strength]);
-       seq_printf(m, "Signal Quality: %s\n", signal[quality]);
-       return 0;
-}
-
-/*
- * seq_file wrappers for procfile show routines.
- */
-static int ft1000_proc_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, ft1000ReadProc, PDE_DATA(inode));
-}
-
-static const struct file_operations ft1000_proc_fops = {
-       .open           = ft1000_proc_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
-static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
-                               void *ptr)
-{
-       struct net_device *dev = netdev_notifier_info_to_dev(ptr);
-       struct ft1000_info *info;
-
-       info = netdev_priv(dev);
-
-       switch (event) {
-       case NETDEV_CHANGENAME:
-               remove_proc_entry(info->netdevname, info->ft1000_proc_dir);
-               proc_create_data(dev->name, 0644, info->ft1000_proc_dir,
-                                &ft1000_proc_fops, dev);
-               snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
-               break;
-       }
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block ft1000_netdev_notifier = {
-       .notifier_call = ft1000NotifyProc
-};
-
-void ft1000InitProc(struct net_device *dev)
-{
-       struct ft1000_info *info;
-
-       info = netdev_priv(dev);
-
-       info->ft1000_proc_dir = proc_mkdir(FT1000_PROC, init_net.proc_net);
-
-       proc_create_data(dev->name, 0644, info->ft1000_proc_dir,
-                        &ft1000_proc_fops, dev);
-
-       snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
-       register_netdevice_notifier(&ft1000_netdev_notifier);
-}
-
-void ft1000CleanupProc(struct net_device *dev)
-{
-       struct ft1000_info *info;
-
-       info = netdev_priv(dev);
-
-       remove_proc_entry(dev->name, info->ft1000_proc_dir);
-       remove_proc_entry(FT1000_PROC, init_net.proc_net);
-       unregister_netdevice_notifier(&ft1000_netdev_notifier);
-}
index f0f524015888c7beb125976e63341ff3c471aa93..7c4b78456254dda4512c78fd90e90992ab3203c3 100644 (file)
@@ -1,3 +1,3 @@
 obj-$(CONFIG_FT1000_USB) += ft1000.o
 
-ft1000-y := ft1000_debug.o ft1000_download.o ft1000_hw.o ft1000_proc.o ft1000_usb.o
+ft1000-y := ft1000_debug.o ft1000_download.o ft1000_hw.o ft1000_usb.o
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c
deleted file mode 100644 (file)
index e89b5d2..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * ft1000_proc.c - ft1000 proc interface
- *
- * Copyright   (C) 2009-2010 Quintec
- *             (C) 2010 Open-nandra
- *      <marek.belisko@open-nandra.com>
- *
- * This file is subject to the terms and conditions of the GNU General
- * Public License. See the file "COPYING" in the main directory of this
- * archive for more details.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/proc_fs.h>
-#include <linux/seq_file.h>
-#include <linux/netdevice.h>
-
-
-#include "ft1000_usb.h"
-
-#define FT1000_PROC_DIR "ft1000"
-
-
-#define seq_putx(m, message, size, var) \
-       do { \
-               seq_printf(m, message); \
-               for (i = 0; i < (size - 1); i++) \
-                       seq_printf(m, "%02x:", var[i]); \
-               seq_printf(m, "%02x\n", var[i]);        \
-       } while (0)
-
-#define seq_putd(m, message, size, var) \
-       do { \
-               seq_printf(m, message); \
-               for (i = 0; i < (size - 1); i++) \
-                       seq_printf(m, "%d.", var[i]); \
-               seq_printf(m, "%d\n", var[i]);        \
-       } while (0)
-
-#define FTNET_PROC init_net.proc_net
-
-
-int ft1000_read_dpram16(struct ft1000_usb *ft1000dev, u16 indx,
-                        u8 *buffer, u8 highlow);
-
-
-static int ft1000ReadProc(struct seq_file *m, void *v)
-{
-       static const char *status[] = {
-               "Idle (Disconnect)",
-               "Searching",
-               "Active (Connected)",
-               "Waiting for L2",
-               "Sleep",
-               "No Coverage",
-               "",
-               "",
-       };
-       static const char *signal[] = { "", "*", "**", "***", "****" };
-
-       struct net_device *dev = m->private;
-       struct ft1000_info *info = netdev_priv(dev);
-       int i;
-       unsigned short ledStat;
-       unsigned short conStat;
-       int strength;
-       int quality;
-       struct timeval tv;
-       time_t delta;
-
-       if (info->ProgConStat != 0xFF) {
-               ft1000_read_dpram16(info->priv, FT1000_MAG_DSP_LED,
-                          (u8 *)&ledStat, FT1000_MAG_DSP_LED_INDX);
-               info->LedStat = ntohs(ledStat);
-
-               ft1000_read_dpram16(info->priv, FT1000_MAG_DSP_CON_STATE,
-                       (u8 *)&conStat, FT1000_MAG_DSP_CON_STATE_INDX);
-               info->ConStat = ntohs(conStat);
-               do_gettimeofday(&tv);
-               delta = (tv.tv_sec - info->ConTm);
-       } else {
-               info->ConStat = 0xf;
-               delta = 0;
-       }
-
-       i = (info->LedStat) & 0xf;
-       switch (i) {
-       case 0x1:
-               strength = 1;
-               break;
-       case 0x3:
-               strength = 2;
-               break;
-       case 0x7:
-               strength = 3;
-               break;
-       case 0xf:
-               strength = 4;
-               break;
-       default:
-               strength = 0;
-       }
-
-       i = (info->LedStat >> 8) & 0xf;
-       switch (i) {
-       case 0x1:
-               quality = 1;
-               break;
-       case 0x3:
-               quality = 2;
-               break;
-       case 0x7:
-               quality = 3;
-               break;
-       case 0xf:
-               quality = 4;
-               break;
-       default:
-               quality = 0;
-       }
-
-       seq_printf(m, "Connection Time: %02ld:%02ld:%02ld\n",
-               ((delta / 3600) % 24), ((delta / 60) % 60), (delta % 60));
-       seq_printf(m, "Connection Time[s]: %ld\n", delta);
-       seq_printf(m, "Asic ID: %s\n",
-       (info->AsicID) == ELECTRABUZZ_ID ? "ELECTRABUZZ ASIC" : "MAGNEMITE ASIC");
-       seq_putx(m, "SKU: ", SKUSZ, info->Sku);
-       seq_putx(m, "EUI64: ", EUISZ, info->eui64);
-       seq_putd(m, "DSP version number: ", DSPVERSZ, info->DspVer);
-       seq_putx(m, "Hardware Serial Number: ", HWSERNUMSZ, info->HwSerNum);
-       seq_putx(m, "Caliberation Version: ", CALVERSZ, info->RfCalVer);
-       seq_putd(m, "Caliberation Date: ", CALDATESZ, info->RfCalDate);
-       seq_printf(m, "Media State: %s\n", (info->mediastate) ? "link" : "no link");
-       seq_printf(m, "Connection Status: %s\n", status[info->ConStat & 0x7]);
-       seq_printf(m, "RX packets: %ld\n", info->stats.rx_packets);
-       seq_printf(m, "TX packets: %ld\n", info->stats.tx_packets);
-       seq_printf(m, "RX bytes: %ld\n", info->stats.rx_bytes);
-       seq_printf(m, "TX bytes: %ld\n", info->stats.tx_bytes);
-       seq_printf(m, "Signal Strength: %s\n", signal[strength]);
-       seq_printf(m, "Signal Quality: %s\n", signal[quality]);
-       return 0;
-}
-
-/*
- * seq_file wrappers for procfile show routines.
- */
-static int ft1000_proc_open(struct inode *inode, struct file *file)
-{
-       return single_open(file, ft1000ReadProc, PDE_DATA(inode));
-}
-
-static const struct file_operations ft1000_proc_fops = {
-       .open           = ft1000_proc_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = single_release,
-};
-
-static int
-ft1000NotifyProc(struct notifier_block *this, unsigned long event, void *ptr)
-{
-       struct net_device *dev = netdev_notifier_info_to_dev(ptr);
-       struct ft1000_info *info;
-       struct proc_dir_entry *ft1000_proc_file;
-
-       info = netdev_priv(dev);
-
-       switch (event) {
-       case NETDEV_CHANGENAME:
-               remove_proc_entry(info->netdevname, info->ft1000_proc_dir);
-               ft1000_proc_file =
-                       proc_create_data(dev->name, 0644, info->ft1000_proc_dir,
-                                        &ft1000_proc_fops, dev);
-               snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
-               break;
-       }
-
-       return NOTIFY_DONE;
-}
-
-static struct notifier_block ft1000_netdev_notifier = {
-       .notifier_call = ft1000NotifyProc,
-};
-
-
-int ft1000_init_proc(struct net_device *dev)
-{
-       struct ft1000_info *info;
-       struct proc_dir_entry *ft1000_proc_file;
-       int ret = -EINVAL;
-
-       info = netdev_priv(dev);
-
-       info->ft1000_proc_dir = proc_mkdir(FT1000_PROC_DIR, FTNET_PROC);
-       if (info->ft1000_proc_dir == NULL) {
-               netdev_warn(dev, "Unable to create %s dir.\n",
-                       FT1000_PROC_DIR);
-               goto fail;
-       }
-
-       ft1000_proc_file =
-               proc_create_data(dev->name, 0644, info->ft1000_proc_dir,
-                                &ft1000_proc_fops, dev);
-
-       if (!ft1000_proc_file) {
-               netdev_warn(dev, "Unable to create /proc entry.\n");
-               goto fail_entry;
-       }
-
-       snprintf(info->netdevname, IFNAMSIZ, "%s", dev->name);
-
-       ret = register_netdevice_notifier(&ft1000_netdev_notifier);
-       if (ret)
-               goto fail_notif;
-
-       return 0;
-
-fail_notif:
-       remove_proc_entry(info->netdevname, info->ft1000_proc_dir);
-fail_entry:
-       remove_proc_entry(FT1000_PROC_DIR, FTNET_PROC);
-fail:
-       return ret;
-}
-
-void ft1000_cleanup_proc(struct ft1000_info *info)
-{
-       remove_proc_entry(info->netdevname, info->ft1000_proc_dir);
-       remove_proc_entry(FT1000_PROC_DIR, FTNET_PROC);
-       unregister_netdevice_notifier(&ft1000_netdev_notifier);
-}
index 0a2544c782924b0b996874bbe29ff38ffb0d7cb6..cc740c96845d029c2fad34d8f52e145a368e0408 100644 (file)
@@ -196,17 +196,10 @@ static int ft1000_probe(struct usb_interface *interface,
        if (ret)
                goto err_thread;
 
-       ret = ft1000_init_proc(ft1000dev->net);
-       if (ret)
-               goto err_proc;
-
        ft1000dev->NetDevRegDone = 1;
 
        return 0;
 
-err_proc:
-       unregister_netdev(ft1000dev->net);
-       free_netdev(ft1000dev->net);
 err_thread:
        kthread_stop(ft1000dev->pPollThread);
 err_load:
@@ -230,7 +223,6 @@ static void ft1000_disconnect(struct usb_interface *interface)
 
        if (pft1000info) {
                ft1000dev = pft1000info->priv;
-               ft1000_cleanup_proc(pft1000info);
                if (ft1000dev->pPollThread)
                        kthread_stop(ft1000dev->pPollThread);
 
index 464e5ab583c110a9ec0ab79c5ab5e01e13a3287f..8f7ccae57f31ff7ba404915493e4acccef749ca2 100644 (file)
@@ -149,7 +149,4 @@ int reg_ft1000_netdev(struct ft1000_usb *ft1000dev,
                      struct usb_interface *intf);
 int ft1000_poll(void *dev_id);
 
-int ft1000_init_proc(struct net_device *dev);
-void ft1000_cleanup_proc(struct ft1000_info *info);
-
 #endif  /* _FT1000_USB_H_ */
index db57430f3b94d34f78a9c7d325558f67e6c8bcd6..8a2e4caa532d33629ce9516eb8dd7257c1998c75 100644 (file)
@@ -363,6 +363,4 @@ struct ft1000_info {
                u16 Rec[MAX_DSP_SESS_REC];
                u32 MagRec[MAX_DSP_SESS_REC/2];
        } DSPSess;
-       struct proc_dir_entry *ft1000_proc_dir;
-       char netdevname[IFNAMSIZ];
 };
This page took 0.034119 seconds and 5 git commands to generate.